code
stringlengths
2
1.05M
System.register([], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; var HEROES; return { setters:[], execute: function() { exports_1("HEROES", HEROES = [ { "id": 1, "name": "Druid" }, { "id": 2, "name": "Hunter" }, { "id": 3, "name": "Mage" }, { "id": 4, "name": "Paladin" }, { "id": 5, "name": "Priest" }, { "id": 6, "name": "Rogue" }, { "id": 7, "name": "Shaman" }, { "id": 8, "name": "Warlock" }, { "id": 9, "name": "Warrior" }, ]); } } }); //# sourceMappingURL=mock-heroes.js.map
search_result['1331']=["topic_000000000000031C.html","tlece_Company.PhoneNumber2 Property",""];
/** * vuex v3.1.2 * (c) 2019 Evan You * @license MIT */ function applyMixin (Vue) { const version = Number(Vue.version.split('.')[0]); if (version >= 2) { Vue.mixin({ beforeCreate: vuexInit }); } else { // override init and inject vuex init procedure // for 1.x backwards compatibility. const _init = Vue.prototype._init; Vue.prototype._init = function (options = {}) { options.init = options.init ? [vuexInit].concat(options.init) : vuexInit; _init.call(this, options); }; } /** * Vuex init hook, injected into each instances init hooks list. */ function vuexInit () { const options = this.$options; // store injection if (options.store) { this.$store = typeof options.store === 'function' ? options.store() : options.store; } else if (options.parent && options.parent.$store) { this.$store = options.parent.$store; } } } const target = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}; const devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__; function devtoolPlugin (store) { if (!devtoolHook) return store._devtoolHook = devtoolHook; devtoolHook.emit('vuex:init', store); devtoolHook.on('vuex:travel-to-state', targetState => { store.replaceState(targetState); }); store.subscribe((mutation, state) => { devtoolHook.emit('vuex:mutation', mutation, state); }); } /** * Get the first item that pass the test * by second argument function * * @param {Array} list * @param {Function} f * @return {*} */ /** * forEach for object */ function forEachValue (obj, fn) { Object.keys(obj).forEach(key => fn(obj[key], key)); } function isObject (obj) { return obj !== null && typeof obj === 'object' } function isPromise (val) { return val && typeof val.then === 'function' } function assert (condition, msg) { if (!condition) throw new Error(`[vuex] ${msg}`) } function partial (fn, arg) { return function () { return fn(arg) } } // Base data struct for store's module, package with some attribute and method class Module { constructor (rawModule, runtime) { this.runtime = runtime; // Store some children item this._children = Object.create(null); // Store the origin module object which passed by programmer this._rawModule = rawModule; const rawState = rawModule.state; // Store the origin module's state this.state = (typeof rawState === 'function' ? rawState() : rawState) || {}; } get namespaced () { return !!this._rawModule.namespaced } addChild (key, module) { this._children[key] = module; } removeChild (key) { delete this._children[key]; } getChild (key) { return this._children[key] } update (rawModule) { this._rawModule.namespaced = rawModule.namespaced; if (rawModule.actions) { this._rawModule.actions = rawModule.actions; } if (rawModule.mutations) { this._rawModule.mutations = rawModule.mutations; } if (rawModule.getters) { this._rawModule.getters = rawModule.getters; } } forEachChild (fn) { forEachValue(this._children, fn); } forEachGetter (fn) { if (this._rawModule.getters) { forEachValue(this._rawModule.getters, fn); } } forEachAction (fn) { if (this._rawModule.actions) { forEachValue(this._rawModule.actions, fn); } } forEachMutation (fn) { if (this._rawModule.mutations) { forEachValue(this._rawModule.mutations, fn); } } } class ModuleCollection { constructor (rawRootModule) { // register root module (Vuex.Store options) this.register([], rawRootModule, false); } get (path) { return path.reduce((module, key) => { return module.getChild(key) }, this.root) } getNamespace (path) { let module = this.root; return path.reduce((namespace, key) => { module = module.getChild(key); return namespace + (module.namespaced ? key + '/' : '') }, '') } update (rawRootModule) { update([], this.root, rawRootModule); } register (path, rawModule, runtime = true) { { assertRawModule(path, rawModule); } const newModule = new Module(rawModule, runtime); if (path.length === 0) { this.root = newModule; } else { const parent = this.get(path.slice(0, -1)); parent.addChild(path[path.length - 1], newModule); } // register nested modules if (rawModule.modules) { forEachValue(rawModule.modules, (rawChildModule, key) => { this.register(path.concat(key), rawChildModule, runtime); }); } } unregister (path) { const parent = this.get(path.slice(0, -1)); const key = path[path.length - 1]; if (!parent.getChild(key).runtime) return parent.removeChild(key); } } function update (path, targetModule, newModule) { { assertRawModule(path, newModule); } // update target module targetModule.update(newModule); // update nested modules if (newModule.modules) { for (const key in newModule.modules) { if (!targetModule.getChild(key)) { { console.warn( `[vuex] trying to add a new module '${key}' on hot reloading, ` + 'manual reload is needed' ); } return } update( path.concat(key), targetModule.getChild(key), newModule.modules[key] ); } } } const functionAssert = { assert: value => typeof value === 'function', expected: 'function' }; const objectAssert = { assert: value => typeof value === 'function' || (typeof value === 'object' && typeof value.handler === 'function'), expected: 'function or object with "handler" function' }; const assertTypes = { getters: functionAssert, mutations: functionAssert, actions: objectAssert }; function assertRawModule (path, rawModule) { Object.keys(assertTypes).forEach(key => { if (!rawModule[key]) return const assertOptions = assertTypes[key]; forEachValue(rawModule[key], (value, type) => { assert( assertOptions.assert(value), makeAssertionMessage(path, key, type, value, assertOptions.expected) ); }); }); } function makeAssertionMessage (path, key, type, value, expected) { let buf = `${key} should be ${expected} but "${key}.${type}"`; if (path.length > 0) { buf += ` in module "${path.join('.')}"`; } buf += ` is ${JSON.stringify(value)}.`; return buf } let Vue; // bind on install class Store { constructor (options = {}) { // Auto install if it is not done yet and `window` has `Vue`. // To allow users to avoid auto-installation in some cases, // this code should be placed here. See #731 if (!Vue && typeof window !== 'undefined' && window.Vue) { install(window.Vue); } { assert(Vue, `must call Vue.use(Vuex) before creating a store instance.`); assert(typeof Promise !== 'undefined', `vuex requires a Promise polyfill in this browser.`); assert(this instanceof Store, `store must be called with the new operator.`); } const { plugins = [], strict = false } = options; // store internal state this._committing = false; this._actions = Object.create(null); this._actionSubscribers = []; this._mutations = Object.create(null); this._wrappedGetters = Object.create(null); this._modules = new ModuleCollection(options); this._modulesNamespaceMap = Object.create(null); this._subscribers = []; this._watcherVM = new Vue(); this._makeLocalGettersCache = Object.create(null); // bind commit and dispatch to self const store = this; const { dispatch, commit } = this; this.dispatch = function boundDispatch (type, payload) { return dispatch.call(store, type, payload) }; this.commit = function boundCommit (type, payload, options) { return commit.call(store, type, payload, options) }; // strict mode this.strict = strict; const state = this._modules.root.state; // init root module. // this also recursively registers all sub-modules // and collects all module getters inside this._wrappedGetters installModule(this, state, [], this._modules.root); // initialize the store vm, which is responsible for the reactivity // (also registers _wrappedGetters as computed properties) resetStoreVM(this, state); // apply plugins plugins.forEach(plugin => plugin(this)); const useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools; if (useDevtools) { devtoolPlugin(this); } } get state () { return this._vm._data.$$state } set state (v) { { assert(false, `use store.replaceState() to explicit replace store state.`); } } commit (_type, _payload, _options) { // check object-style commit const { type, payload, options } = unifyObjectStyle(_type, _payload, _options); const mutation = { type, payload }; const entry = this._mutations[type]; if (!entry) { { console.error(`[vuex] unknown mutation type: ${type}`); } return } this._withCommit(() => { entry.forEach(function commitIterator (handler) { handler(payload); }); }); this._subscribers.forEach(sub => sub(mutation, this.state)); if ( options && options.silent ) { console.warn( `[vuex] mutation type: ${type}. Silent option has been removed. ` + 'Use the filter functionality in the vue-devtools' ); } } dispatch (_type, _payload) { // check object-style dispatch const { type, payload } = unifyObjectStyle(_type, _payload); const action = { type, payload }; const entry = this._actions[type]; if (!entry) { { console.error(`[vuex] unknown action type: ${type}`); } return } try { this._actionSubscribers .filter(sub => sub.before) .forEach(sub => sub.before(action, this.state)); } catch (e) { { console.warn(`[vuex] error in before action subscribers: `); console.error(e); } } const result = entry.length > 1 ? Promise.all(entry.map(handler => handler(payload))) : entry[0](payload); return result.then(res => { try { this._actionSubscribers .filter(sub => sub.after) .forEach(sub => sub.after(action, this.state)); } catch (e) { { console.warn(`[vuex] error in after action subscribers: `); console.error(e); } } return res }) } subscribe (fn) { return genericSubscribe(fn, this._subscribers) } subscribeAction (fn) { const subs = typeof fn === 'function' ? { before: fn } : fn; return genericSubscribe(subs, this._actionSubscribers) } watch (getter, cb, options) { { assert(typeof getter === 'function', `store.watch only accepts a function.`); } return this._watcherVM.$watch(() => getter(this.state, this.getters), cb, options) } replaceState (state) { this._withCommit(() => { this._vm._data.$$state = state; }); } registerModule (path, rawModule, options = {}) { if (typeof path === 'string') path = [path]; { assert(Array.isArray(path), `module path must be a string or an Array.`); assert(path.length > 0, 'cannot register the root module by using registerModule.'); } this._modules.register(path, rawModule); installModule(this, this.state, path, this._modules.get(path), options.preserveState); // reset store to update getters... resetStoreVM(this, this.state); } unregisterModule (path) { if (typeof path === 'string') path = [path]; { assert(Array.isArray(path), `module path must be a string or an Array.`); } this._modules.unregister(path); this._withCommit(() => { const parentState = getNestedState(this.state, path.slice(0, -1)); Vue.delete(parentState, path[path.length - 1]); }); resetStore(this); } hotUpdate (newOptions) { this._modules.update(newOptions); resetStore(this, true); } _withCommit (fn) { const committing = this._committing; this._committing = true; fn(); this._committing = committing; } } function genericSubscribe (fn, subs) { if (subs.indexOf(fn) < 0) { subs.push(fn); } return () => { const i = subs.indexOf(fn); if (i > -1) { subs.splice(i, 1); } } } function resetStore (store, hot) { store._actions = Object.create(null); store._mutations = Object.create(null); store._wrappedGetters = Object.create(null); store._modulesNamespaceMap = Object.create(null); const state = store.state; // init all modules installModule(store, state, [], store._modules.root, true); // reset vm resetStoreVM(store, state, hot); } function resetStoreVM (store, state, hot) { const oldVm = store._vm; // bind store public getters store.getters = {}; // reset local getters cache store._makeLocalGettersCache = Object.create(null); const wrappedGetters = store._wrappedGetters; const computed = {}; forEachValue(wrappedGetters, (fn, key) => { // use computed to leverage its lazy-caching mechanism // direct inline function use will lead to closure preserving oldVm. // using partial to return function with only arguments preserved in closure environment. computed[key] = partial(fn, store); Object.defineProperty(store.getters, key, { get: () => store._vm[key], enumerable: true // for local getters }); }); // use a Vue instance to store the state tree // suppress warnings just in case the user has added // some funky global mixins const silent = Vue.config.silent; Vue.config.silent = true; store._vm = new Vue({ data: { $$state: state }, computed }); Vue.config.silent = silent; // enable strict mode for new vm if (store.strict) { enableStrictMode(store); } if (oldVm) { if (hot) { // dispatch changes in all subscribed watchers // to force getter re-evaluation for hot reloading. store._withCommit(() => { oldVm._data.$$state = null; }); } Vue.nextTick(() => oldVm.$destroy()); } } function installModule (store, rootState, path, module, hot) { const isRoot = !path.length; const namespace = store._modules.getNamespace(path); // register in namespace map if (module.namespaced) { if (store._modulesNamespaceMap[namespace] && "development" !== 'production') { console.error(`[vuex] duplicate namespace ${namespace} for the namespaced module ${path.join('/')}`); } store._modulesNamespaceMap[namespace] = module; } // set state if (!isRoot && !hot) { const parentState = getNestedState(rootState, path.slice(0, -1)); const moduleName = path[path.length - 1]; store._withCommit(() => { { if (moduleName in parentState) { console.warn( `[vuex] state field "${moduleName}" was overridden by a module with the same name at "${path.join('.')}"` ); } } Vue.set(parentState, moduleName, module.state); }); } const local = module.context = makeLocalContext(store, namespace, path); module.forEachMutation((mutation, key) => { const namespacedType = namespace + key; registerMutation(store, namespacedType, mutation, local); }); module.forEachAction((action, key) => { const type = action.root ? key : namespace + key; const handler = action.handler || action; registerAction(store, type, handler, local); }); module.forEachGetter((getter, key) => { const namespacedType = namespace + key; registerGetter(store, namespacedType, getter, local); }); module.forEachChild((child, key) => { installModule(store, rootState, path.concat(key), child, hot); }); } /** * make localized dispatch, commit, getters and state * if there is no namespace, just use root ones */ function makeLocalContext (store, namespace, path) { const noNamespace = namespace === ''; const local = { dispatch: noNamespace ? store.dispatch : (_type, _payload, _options) => { const args = unifyObjectStyle(_type, _payload, _options); const { payload, options } = args; let { type } = args; if (!options || !options.root) { type = namespace + type; if (!store._actions[type]) { console.error(`[vuex] unknown local action type: ${args.type}, global type: ${type}`); return } } return store.dispatch(type, payload) }, commit: noNamespace ? store.commit : (_type, _payload, _options) => { const args = unifyObjectStyle(_type, _payload, _options); const { payload, options } = args; let { type } = args; if (!options || !options.root) { type = namespace + type; if (!store._mutations[type]) { console.error(`[vuex] unknown local mutation type: ${args.type}, global type: ${type}`); return } } store.commit(type, payload, options); } }; // getters and state object must be gotten lazily // because they will be changed by vm update Object.defineProperties(local, { getters: { get: noNamespace ? () => store.getters : () => makeLocalGetters(store, namespace) }, state: { get: () => getNestedState(store.state, path) } }); return local } function makeLocalGetters (store, namespace) { if (!store._makeLocalGettersCache[namespace]) { const gettersProxy = {}; const splitPos = namespace.length; Object.keys(store.getters).forEach(type => { // skip if the target getter is not match this namespace if (type.slice(0, splitPos) !== namespace) return // extract local getter type const localType = type.slice(splitPos); // Add a port to the getters proxy. // Define as getter property because // we do not want to evaluate the getters in this time. Object.defineProperty(gettersProxy, localType, { get: () => store.getters[type], enumerable: true }); }); store._makeLocalGettersCache[namespace] = gettersProxy; } return store._makeLocalGettersCache[namespace] } function registerMutation (store, type, handler, local) { const entry = store._mutations[type] || (store._mutations[type] = []); entry.push(function wrappedMutationHandler (payload) { handler.call(store, local.state, payload); }); } function registerAction (store, type, handler, local) { const entry = store._actions[type] || (store._actions[type] = []); entry.push(function wrappedActionHandler (payload) { let res = handler.call(store, { dispatch: local.dispatch, commit: local.commit, getters: local.getters, state: local.state, rootGetters: store.getters, rootState: store.state }, payload); if (!isPromise(res)) { res = Promise.resolve(res); } if (store._devtoolHook) { return res.catch(err => { store._devtoolHook.emit('vuex:error', err); throw err }) } else { return res } }); } function registerGetter (store, type, rawGetter, local) { if (store._wrappedGetters[type]) { { console.error(`[vuex] duplicate getter key: ${type}`); } return } store._wrappedGetters[type] = function wrappedGetter (store) { return rawGetter( local.state, // local state local.getters, // local getters store.state, // root state store.getters // root getters ) }; } function enableStrictMode (store) { store._vm.$watch(function () { return this._data.$$state }, () => { { assert(store._committing, `do not mutate vuex store state outside mutation handlers.`); } }, { deep: true, sync: true }); } function getNestedState (state, path) { return path.length ? path.reduce((state, key) => state[key], state) : state } function unifyObjectStyle (type, payload, options) { if (isObject(type) && type.type) { options = payload; payload = type; type = type.type; } { assert(typeof type === 'string', `expects string as the type, but found ${typeof type}.`); } return { type, payload, options } } function install (_Vue) { if (Vue && _Vue === Vue) { { console.error( '[vuex] already installed. Vue.use(Vuex) should be called only once.' ); } return } Vue = _Vue; applyMixin(Vue); } /** * Reduce the code which written in Vue.js for getting the state. * @param {String} [namespace] - Module's namespace * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it. * @param {Object} */ const mapState = normalizeNamespace((namespace, states) => { const res = {}; if (!isValidMap(states)) { console.error('[vuex] mapState: mapper parameter must be either an Array or an Object'); } normalizeMap(states).forEach(({ key, val }) => { res[key] = function mappedState () { let state = this.$store.state; let getters = this.$store.getters; if (namespace) { const module = getModuleByNamespace(this.$store, 'mapState', namespace); if (!module) { return } state = module.context.state; getters = module.context.getters; } return typeof val === 'function' ? val.call(this, state, getters) : state[val] }; // mark vuex getter for devtools res[key].vuex = true; }); return res }); /** * Reduce the code which written in Vue.js for committing the mutation * @param {String} [namespace] - Module's namespace * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function. * @return {Object} */ const mapMutations = normalizeNamespace((namespace, mutations) => { const res = {}; if (!isValidMap(mutations)) { console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object'); } normalizeMap(mutations).forEach(({ key, val }) => { res[key] = function mappedMutation (...args) { // Get the commit method from store let commit = this.$store.commit; if (namespace) { const module = getModuleByNamespace(this.$store, 'mapMutations', namespace); if (!module) { return } commit = module.context.commit; } return typeof val === 'function' ? val.apply(this, [commit].concat(args)) : commit.apply(this.$store, [val].concat(args)) }; }); return res }); /** * Reduce the code which written in Vue.js for getting the getters * @param {String} [namespace] - Module's namespace * @param {Object|Array} getters * @return {Object} */ const mapGetters = normalizeNamespace((namespace, getters) => { const res = {}; if (!isValidMap(getters)) { console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object'); } normalizeMap(getters).forEach(({ key, val }) => { // The namespace has been mutated by normalizeNamespace val = namespace + val; res[key] = function mappedGetter () { if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) { return } if (!(val in this.$store.getters)) { console.error(`[vuex] unknown getter: ${val}`); return } return this.$store.getters[val] }; // mark vuex getter for devtools res[key].vuex = true; }); return res }); /** * Reduce the code which written in Vue.js for dispatch the action * @param {String} [namespace] - Module's namespace * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function. * @return {Object} */ const mapActions = normalizeNamespace((namespace, actions) => { const res = {}; if (!isValidMap(actions)) { console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object'); } normalizeMap(actions).forEach(({ key, val }) => { res[key] = function mappedAction (...args) { // get dispatch function from store let dispatch = this.$store.dispatch; if (namespace) { const module = getModuleByNamespace(this.$store, 'mapActions', namespace); if (!module) { return } dispatch = module.context.dispatch; } return typeof val === 'function' ? val.apply(this, [dispatch].concat(args)) : dispatch.apply(this.$store, [val].concat(args)) }; }); return res }); /** * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object * @param {String} namespace * @return {Object} */ const createNamespacedHelpers = (namespace) => ({ mapState: mapState.bind(null, namespace), mapGetters: mapGetters.bind(null, namespace), mapMutations: mapMutations.bind(null, namespace), mapActions: mapActions.bind(null, namespace) }); /** * Normalize the map * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ] * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ] * @param {Array|Object} map * @return {Object} */ function normalizeMap (map) { if (!isValidMap(map)) { return [] } return Array.isArray(map) ? map.map(key => ({ key, val: key })) : Object.keys(map).map(key => ({ key, val: map[key] })) } /** * Validate whether given map is valid or not * @param {*} map * @return {Boolean} */ function isValidMap (map) { return Array.isArray(map) || isObject(map) } /** * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map. * @param {Function} fn * @return {Function} */ function normalizeNamespace (fn) { return (namespace, map) => { if (typeof namespace !== 'string') { map = namespace; namespace = ''; } else if (namespace.charAt(namespace.length - 1) !== '/') { namespace += '/'; } return fn(namespace, map) } } /** * Search a special module from store by namespace. if module not exist, print error message. * @param {Object} store * @param {String} helper * @param {String} namespace * @return {Object} */ function getModuleByNamespace (store, helper, namespace) { const module = store._modulesNamespaceMap[namespace]; if (!module) { console.error(`[vuex] module namespace not found in ${helper}(): ${namespace}`); } return module } var index_esm = { Store, install, version: '3.1.2', mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers }; export default index_esm; export { Store, install, mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers };
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See http://js.arcgis.com/3.17/esri/copyright.txt for details. //>>built define("esri/dijit/nls/AttributeInspector-all_ca",{"dijit/_editor/nls/commands":{bold:"Negreta",copy:"Copia",cut:"Retalla","delete":"Suprimeix",indent:"Sagnat",insertHorizontalRule:"Regla horitzontal",insertOrderedList:"Llista numerada",insertUnorderedList:"Llista de vinyetes",italic:"Cursiva",justifyCenter:"Alineaci\u00f3 centrada",justifyFull:"Justifica",justifyLeft:"Alineaci\u00f3 a l'esquerra",justifyRight:"Alineaci\u00f3 a la dreta",outdent:"Sagnat a l'esquerra",paste:"Enganxa",redo:"Ref\u00e9s", removeFormat:"Elimina el format",selectAll:"Selecciona-ho tot",strikethrough:"Ratllat",subscript:"Sub\u00edndex",superscript:"Super\u00edndex",underline:"Subratllat",undo:"Desf\u00e9s",unlink:"Elimina l'enlla\u00e7",createLink:"Crea un enlla\u00e7",toggleDir:"Inverteix la direcci\u00f3",insertImage:"Insereix imatge",insertTable:"Insereix/edita la taula",toggleTableBorder:"Inverteix els contorns de taula",deleteTable:"Suprimeix la taula",tableProp:"Propietat de taula",htmlToggle:"Font HTML",foreColor:"Color de primer pla", hiliteColor:"Color de fons",plainFormatBlock:"Estil de par\u00e0graf",formatBlock:"Estil de par\u00e0graf",fontSize:"Mida del tipus de lletra",fontName:"Nom del tipus de lletra",tabIndent:"Sagnat",fullScreen:"Commuta pantalla completa",viewSource:"Visualitza font HTML",print:"Imprimeix",newPage:"P\u00e0gina nova",systemShortcut:"L'acci\u00f3 \"${0}\" \u00e9s l'\u00fanica disponible al navegador utilitzant una drecera del teclat. Utilitzeu ${1}.",ctrlKey:"control+${0}",appleKey:"\u2318${0}",_localized:{}}, "dijit/form/nls/ComboBox":{previousMessage:"Opcions anteriors",nextMessage:"M\u00e9s opcions",_localized:{}},"dojo/cldr/nls/islamic":{"dateFormatItem-Ehm":"E h:mm a","days-standAlone-short":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"months-format-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"field-second-relative+0":"now","quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","field-wed-relative+0":"this Wednesday","field-wed-relative+1":"next Wednesday","dateFormatItem-GyMMMEd":"G y MMM d, E", "dateFormatItem-MMMEd":"MMM d, E",eraNarrow:["AH"],"field-tue-relative+-1":"last Tuesday","days-format-short":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"G y MMMM d","field-fri-relative+-1":"last Friday","field-wed-relative+-1":"last Wednesday","months-format-wide":"Muharram;Safar;Rabi\u02bb I;Rabi\u02bb II;Jumada I;Jumada II;Rajab;Sha\u02bbban;Ramadan;Shawwal;Dhu\u02bbl-Qi\u02bbdah;Dhu\u02bbl-Hijjah".split(";"),"dateFormatItem-yyyyQQQ":"G y QQQ", "dateTimeFormat-medium":"{1} {0}","dayPeriods-format-wide-pm":"PM","dateFormat-full":"G y MMMM d, EEEE","dateFormatItem-yyyyMEd":"GGGGG y-MM-dd, E","field-thu-relative+-1":"last Thursday","dateFormatItem-Md":"MM-dd","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dayPeriods-format-wide-noon":"noon","field-era":"Era","months-standAlone-wide":"Muharram;Safar;Rabi\u02bb I;Rabi\u02bb II;Jumada I;Jumada II;Rajab;Sha\u02bbban;Ramadan;Shawwal;Dhu\u02bbl-Qi\u02bbdah;Dhu\u02bbl-Hijjah".split(";"), "timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year","dateTimeFormats-appendItem-Era":"{1} {0}","field-hour":"Hour","months-format-abbr":"Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhu\u02bbl-Q.;Dhu\u02bbl-H.".split(";"),"field-sat-relative+0":"this Saturday","field-sat-relative+1":"next Saturday","timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"today", "field-thu-relative+0":"this Thursday","field-day-relative+1":"tomorrow","field-thu-relative+1":"next Thursday","dateFormatItem-GyMMMd":"G y MMM d","dateFormatItem-H":"HH","months-standAlone-abbr":"Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhu\u02bbl-Q.;Dhu\u02bbl-H.".split(";"),"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-Gy":"G y","dateFormatItem-yyyyMMMEd":"G y MMM d, E","dateFormatItem-M":"L","days-standAlone-wide":"Sun Mon Tue Wed Thu Fri Sat".split(" "), "dateFormatItem-yyyyMMM":"G y MMM","dateFormatItem-yyyyMMMd":"G y MMM d","dayPeriods-format-abbr-noon":"noon","timeFormat-medium":"HH:mm:ss","field-sun-relative+0":"this Sunday","dateFormatItem-Hm":"HH:mm","field-sun-relative+1":"next Sunday","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["AH"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1", "2","3","4"],"field-day-relative+-1":"yesterday","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"a","dateFormatItem-h":"h a","dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"MM-dd, E","dateTimeFormat-full":"{1} {0}","field-fri-relative+0":"this Friday","field-fri-relative+1":"next Friday","field-day":"Day","days-format-wide":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"field-zone":"Zone","months-standAlone-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"dateFormatItem-y":"G y","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})", "field-year-relative+-1":"last year","field-month-relative+-1":"last month","dateTimeFormats-appendItem-Year":"{1} {0}","dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":"Sun Mon Tue Wed Thu Fri Sat".split(" "),eraNames:["AH"],"days-format-narrow":"SMTWTFS".split(""),"dateFormatItem-yyyyMd":"GGGGG y-MM-dd","field-month":"Month","days-standAlone-narrow":"SMTWTFS".split(""),"dateFormatItem-MMM":"LLL","field-tue-relative+0":"this Tuesday", "field-tue-relative+1":"next Tuesday","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormatItem-EHm":"E HH:mm","field-mon-relative+0":"this Monday","field-mon-relative+1":"next Monday","dateFormat-short":"GGGGG y-MM-dd","dateFormatItem-EHms":"E HH:mm:ss","dateFormatItem-Ehms":"E h:mm:ss a","dayPeriods-format-narrow-noon":"n","field-second":"Second", "field-sat-relative+-1":"last Saturday","field-sun-relative+-1":"last Sunday","field-month-relative+0":"this month","field-month-relative+1":"next month","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateFormatItem-Ed":"d, E","field-week":"Week","dateFormat-medium":"G y MMM d","field-week-relative+-1":"last week","field-year-relative+0":"this year","dateFormatItem-yyyyM":"GGGGG y-MM","field-year-relative+1":"next year","dayPeriods-format-narrow-pm":"p","dateFormatItem-yyyyQQQQ":"G y QQQQ","dateTimeFormat-short":"{1} {0}", "dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-GyMMM":"G y MMM","field-mon-relative+-1":"last Monday","dateFormatItem-yyyy":"G y","field-week-relative+0":"this week","field-week-relative+1":"next week",_localized:{}}});
/* * * Placeholder.js 1.1.1 * Creates placeholder on inputs/textareas for browsers that don't support it (well, IE...) * * @ Created by Guillaume Gaubert * @ http://widgetulous.com/placeholderjs/ * @ © 2011 Guillaume Gaubert * * @ Default use : * Placeholder.init(); * */ Placeholder = { // The normal and placeholder colors defaultSettings : { normal : '#000000', placeholder : '#C0C0C0', wait : false, classFocus : '', classBlur : '' }, init: function(settings) { // Merge default settings with the ones provided if(settings) { // Merge the desired settings for(var property in settings) { Placeholder.defaultSettings[property] = settings[property]; } } // Let's make the funky part... // Get inputs and textareas var inputs = document.getElementsByTagName("input"); var textareas = document.getElementsByTagName("textarea"); // Merge all that var elements = Placeholder.utils.concat(inputs, textareas); // Bind events to all the elements for (var i = 0; i < elements.length; i++) { var placeholder = elements[i].getAttribute("placeholder"); if(placeholder && elements[i].type == "text" || elements[i].type == "password" || elements[i].type == "textarea") { var _input = elements[i]; // Bind events _input.onclick = function(){ Placeholder.onSelected(this); }; _input.onfocus = function(){ }; _input.onblur = function(){ Placeholder.unSelected(this); }; // Only if we want that wait feature if(Placeholder.defaultSettings.wait) { _input.onkeypress = function(){ Placeholder.onType(this); }; } // Set style and value Placeholder.style.inactive(_input); _input.value = placeholder; //_input.className = Placeholder.defaultSettings.class; // Check for parent forms var forms = document.getElementsByTagName('form'); for(var f = 0; f < forms.length; f++) { if(forms[f]) { // Check if the current input is a child of that form var children = forms[f].children; if(Placeholder.utils.contains(children, _input)) { // Bind the submit to clear all empty fields forms[f].onsubmit = function() { Placeholder.submitted(this); }; } } } } }; }, // Called when an input/textarea is selected onSelected: function(input) { if(Placeholder.defaultSettings.wait == true) { if(input.value == input.getAttribute('placeholder')) { Placeholder.utils.caret(input); } } else { if(input.value == input.getAttribute('placeholder')) { input.value = ''; } Placeholder.style.normal(input); } }, // Called on onkeypressed of an input/textarea, used for the 'wait' setting onType: function(input) { var placeholder = input.getAttribute('placeholder'); input.value = input.value.replace(placeholder, ''); /*if(input.value != placeholder) { var diff = input.value.length - placeholder.length; // Check if this is the first character typed if(diff >= 1 && input.value.indexOf(placeholder) != -1) { input.value = input.value.substring(0, diff); } Placeholder.style.normal(input); }*/ // Check if the text field is empty, so back to the inactive state if(input.value.length <= 0) { Placeholder.style.inactive(input); input.value = placeholder; Placeholder.utils.caret(input); } else { Placeholder.style.normal(input); } }, // Called when an input/textarea is unselected // It applies the placeholder state if input value is empty unSelected: function(input) { // Reset a placeholder if the user didn't type text if(input.value.length <= 0) { Placeholder.style.inactive(input); input.value = input.getAttribute("placeholder"); } }, // Called when a form containing an input/textarea is submitted // If one of these are empty (placeholder is left), we clear the value for each submitted: function(form) { var children = form.children; for(var i = 0; i < children.length; i++) { if(children[i]) { var node = children[i]; if(node.tagName.toLowerCase() == "input" || node.tagName.toLowerCase() == "textarea") { if(node.value == node.getAttribute('placeholder')) { node.value = ""; } } } } }, // Style // Manage styles for normal and inactive style : { // Apply the normal style to the element normal: function(input) { // Check if class if set so we use that if(Placeholder.defaultSettings.classFocus) { input.className = Placeholder.defaultSettings.classFocus; } else { // Use the text color input.style.color = Placeholder.defaultSettings.normal; } }, // Apply the inactive style to the element inactive: function(input) { // Check if class if set so we use that if(Placeholder.defaultSettings.classBlur) { input.className = Placeholder.defaultSettings.classBlur; } else { // Use the text color input.style.color = Placeholder.defaultSettings.placeholder; } } }, // Utils // Private methods utils : { // Check if array contains el contains: function(array, el) { for(var i = 0; i < array.length; i++) { if(array[i]) { if(array[i] == el) { return true; } } } return false; }, // Merge two node lists concat: function(node1, node2) { var array = []; for(var i = 0; i < node1.length; i++) { if(node1[i]) { array.push(node1[i]); } } for(var i = 0; i < node2.length; i++) { if(node2[i]) { array.push(node2[i]); } } return array; }, // Set caret position to the beginning caret: function(input) { if(input.setSelectionRange) { input.focus(); input.setSelectionRange(0,0); } else if(input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', 0); range.moveStart('character', 0); range.select(); } } } };
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See http://js.arcgis.com/3.17/esri/copyright.txt for details. //>>built define("esri/dijit/editing/nls/Editor_nl-nl",{"dijit/_editor/nls/commands":{bold:"Vet",copy:"Kopi\u00ebren",cut:"Knippen","delete":"Wissen",indent:"Inspringen",insertHorizontalRule:"Horizontale liniaal",insertOrderedList:"Genummerde lijst",insertUnorderedList:"Lijst met opsommingstekens",italic:"Cursief",justifyCenter:"Centreren",justifyFull:"Uitvullen",justifyLeft:"Links uitlijnen",justifyRight:"Rechts uitlijnen",outdent:"Uitspringen",paste:"Plakken",redo:"Opnieuw",removeFormat:"Opmaak verwijderen", selectAll:"Alles selecteren",strikethrough:"Doorhalen",subscript:"Subscript",superscript:"Superscript",underline:"Onderstrepen",undo:"Ongedaan maken",unlink:"Link verwijderen",createLink:"Link maken",toggleDir:"Schrijfrichting wijzigen",insertImage:"Afbeelding invoegen",insertTable:"Tabel invoegen/bewerken",toggleTableBorder:"Tabelkader wijzigen",deleteTable:"Tabel wissen",tableProp:"Tabeleigenschap",htmlToggle:"HTML-bron",foreColor:"Voorgrondkleur",hiliteColor:"Achtergrondkleur",plainFormatBlock:"Alineastijl", formatBlock:"Alineastijl",fontSize:"Lettergrootte",fontName:"Lettertype",tabIndent:"Inspringen",fullScreen:"Volledig scherm in-/uitschakelen",viewSource:"HTML-bron bekijken",print:"Afdrukken",newPage:"Nieuwe pagina",systemShortcut:'De actie "${0}" is alleen beschikbaar in uw browser via een sneltoetscombinatie. Gebruik ${1}.',ctrlKey:"ctrl+${0}",appleKey:"\u2318${0}",_localized:{}},"dijit/form/nls/ComboBox":{previousMessage:"Eerdere opties",nextMessage:"Meer opties",_localized:{}},"dojo/cldr/nls/islamic":{"dateFormatItem-Ehm":"E h:mm a", "days-standAlone-short":"zo ma di wo do vr za".split(" "),"months-format-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"field-second-relative+0":"nu","quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Dag van de week","field-wed-relative+0":"deze woensdag","field-wed-relative+1":"volgende week woensdag","dateFormatItem-GyMMMEd":"E d MMM y G","dateFormatItem-MMMEd":"E d MMM",eraNarrow:["Sa\u02bbna Hizjria"],"field-tue-relative+-1":"afgelopen dinsdag","days-format-short":"zo ma di wo do vr za".split(" "), "dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"d MMMM y G","field-fri-relative+-1":"afgelopen vrijdag","field-wed-relative+-1":"afgelopen woensdag","months-format-wide":"Moeharram;Safar;Rabi\u02bba al awal;Rabi\u02bba al thani;Joemad\u02bbal awal;Joemad\u02bbal thani;Rajab;Sja\u02bbaban;Ramadan;Sjawal;Doe al ka\u02bbaba;Doe al hizja".split(";"),"dateFormatItem-yyyyQQQ":"QQQ y G","dateTimeFormat-medium":"{1} {0}","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE d MMMM y G", "dateFormatItem-yyyyMEd":"E d-M-y GGGGG","field-thu-relative+-1":"afgelopen donderdag","dateFormatItem-Md":"d-M","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dayPeriods-format-wide-noon":"12 uur 's middags","field-era":"Tijdperk","months-standAlone-wide":"Moeharram;Safar;Rabi\u02bba al awal;Rabi\u02bba al thani;Joemad\u02bbal awal;Joemad\u02bbal thani;Rajab;Sja\u02bbaban;Ramadan;Sjawal;Doe al ka\u02bbaba;Doe al hizja".split(";"),"timeFormat-short":"HH:mm", "quarters-format-wide":["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"],"timeFormat-long":"HH:mm:ss z","field-year":"Jaar","dateTimeFormats-appendItem-Era":"{1} {0}","field-hour":"Uur","months-format-abbr":"Moeh.;Saf.;Rab. I;Rab. II;Joem. I;Joem. II;Raj.;Sja.;Ram.;Sjaw.;Doe al k.;Doe al h.".split(";"),"field-sat-relative+0":"deze zaterdag","field-sat-relative+1":"volgende week zaterdag","timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"vandaag", "field-thu-relative+0":"deze donderdag","field-day-relative+1":"morgen","field-thu-relative+1":"volgende week donderdag","dateFormatItem-GyMMMd":"d MMM y G","dateFormatItem-H":"HH","months-standAlone-abbr":"Moeh.;Saf.;Rab. I;Rab. II;Joem. I;Joem. II;Raj.;Sja.;Ram.;Sjaw.;Doe al k.;Doe al h.".split(";"),"quarters-format-abbr":["K1","K2","K3","K4"],"quarters-standAlone-wide":["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"],"dateFormatItem-Gy":"y G","dateFormatItem-yyyyMMMEd":"E d MMM y G","dateFormatItem-M":"L", "days-standAlone-wide":"zondag maandag dinsdag woensdag donderdag vrijdag zaterdag".split(" "),"dateFormatItem-yyyyMMM":"MMM y G","dateFormatItem-yyyyMMMd":"d MMM y G","dayPeriods-format-abbr-noon":"12 uur 's middags","timeFormat-medium":"HH:mm:ss","field-sun-relative+0":"deze zondag","dateFormatItem-Hm":"HH:mm","field-sun-relative+1":"volgende week zondag","quarters-standAlone-abbr":["K1","K2","K3","K4"],eraAbbr:["Sa\u02bbna Hizjria"],"field-minute":"Minuut","field-dayperiod":"AM/PM","days-standAlone-abbr":"zo ma di wo do vr za".split(" "), "dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"gisteren","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM","dateFormatItem-h":"h a","dateFormatItem-MMMd":"d MMM","dateFormatItem-MEd":"E d-M","dateTimeFormat-full":"{1} {0}","field-fri-relative+0":"deze vrijdag","field-fri-relative+1":"volgende week vrijdag","field-day":"Dag","days-format-wide":"zondag maandag dinsdag woensdag donderdag vrijdag zaterdag".split(" "), "field-zone":"Zone","months-standAlone-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"dateFormatItem-y":"y G","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","field-year-relative+-1":"vorig jaar","field-month-relative+-1":"vorige maand","dateTimeFormats-appendItem-Year":"{1} {0}","dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":"zo ma di wo do vr za".split(" "),eraNames:["Sa\u02bbna Hizjria"],"days-format-narrow":"ZMDWDVZ".split(""), "dateFormatItem-yyyyMd":"d-M-y GGGGG","field-month":"Maand","days-standAlone-narrow":"ZMDWDVZ".split(""),"dateFormatItem-MMM":"LLL","field-tue-relative+0":"deze dinsdag","field-tue-relative+1":"volgende week dinsdag","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormatItem-EHm":"E HH:mm","field-mon-relative+0":"deze maandag","field-mon-relative+1":"volgende week maandag", "dateFormat-short":"dd-MM-yy GGGGG","dateFormatItem-EHms":"E HH:mm:ss","dateFormatItem-Ehms":"E h:mm:ss a","dayPeriods-format-narrow-noon":"n","field-second":"Seconde","field-sat-relative+-1":"afgelopen zaterdag","field-sun-relative+-1":"afgelopen zondag","field-month-relative+0":"deze maand","field-month-relative+1":"volgende maand","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateFormatItem-Ed":"E d","field-week":"Week","dateFormat-medium":"d MMM y G","field-week-relative+-1":"vorige week", "field-year-relative+0":"dit jaar","dateFormatItem-yyyyM":"M-y GGGGG","field-year-relative+1":"volgend jaar","dayPeriods-format-narrow-pm":"PM","dateFormatItem-yyyyQQQQ":"QQQQ y G","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-GyMMM":"MMM y G","field-mon-relative+-1":"afgelopen maandag","dateFormatItem-yyyy":"y G","field-week-relative+0":"deze week","field-week-relative+1":"volgende week","dateFormatItem-yyyyMMMM":"MMMM y G","field-day-relative+2":"overmorgen", "dateFormatItem-MMMMd":"d MMMM","field-day-relative+-2":"eergisteren",_localized:{}}});
'use strict'; module.exports = { db: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://localhost/democalendarize', assets: { lib: { css: [ 'public/lib/bootstrap/dist/css/bootstrap.min.css', 'public/lib/bootstrap/dist/css/bootstrap-theme.min.css', ], js: [ 'public/lib/angular/angular.min.js', 'public/lib/angular-resource/angular-resource.js', 'public/lib/angular-cookies/angular-cookies.js', 'public/lib/angular-animate/angular-animate.js', 'public/lib/angular-touch/angular-touch.js', 'public/lib/angular-sanitize/angular-sanitize.js', 'public/lib/angular-ui-router/release/angular-ui-router.min.js', 'public/lib/angular-ui-utils/ui-utils.min.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.min.js' ] }, css: 'public/dist/application.min.css', js: 'public/dist/application.min.js' }, facebook: { clientID: process.env.FACEBOOK_ID || 'APP_ID', clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET', callbackURL: 'http://localhost:3000/auth/facebook/callback' }, twitter: { clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY', clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET', callbackURL: 'http://localhost:3000/auth/twitter/callback' }, google: { clientID: process.env.GOOGLE_ID || 'APP_ID', clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET', callbackURL: 'http://localhost:3000/auth/google/callback' }, linkedin: { clientID: process.env.LINKEDIN_ID || 'APP_ID', clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET', callbackURL: 'http://localhost:3000/auth/linkedin/callback' }, github: { clientID: process.env.GITHUB_ID || 'APP_ID', clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET', callbackURL: 'http://localhost:3000/auth/github/callback' }, mailer: { from: process.env.MAILER_FROM || 'MAILER_FROM', options: { service: process.env.MAILER_SERVICE_PROVIDER || 'MAILER_SERVICE_PROVIDER', auth: { user: process.env.MAILER_EMAIL_ID || 'MAILER_EMAIL_ID', pass: process.env.MAILER_PASSWORD || 'MAILER_PASSWORD' } } } };
export default { component: () => import('./index'), config: () => ({ name: '标题文字', desc: '标题文字', component: 'text', content: { component: 'textDesign', data: { url: { type: 'navigate', page: '', query: '' }, title: '标题文字' // 文本内容 } }, style: [ // 那些样式是可以编辑的 { key: "title", // 标志唯一 name: "字体", // 装修组件上的名称 items: [ // 可编辑的项 { key: "color", title: '颜色', component: "color", value: "#333333" }, { key: "fontSize", title: '大小', component: "slider", min: 10, max: 100, value: "14px" }, { key: "lineHeight", title: '行高', min: 0, max: 100, component: "slider", value: "40px" }, { key: "textAlign", title: '对齐方式', component: "radioGroup", options: [ { label: '左对齐', value: 'left' }, { label: '居中', value: 'center' }, { label: '右对齐', value: 'right' }, ], value: "center" }, { key: "backgroundColor", title: '背景颜色', component: "color", value: "#ffffff" }, ] } ] }) }
'use strict'; angular.module('atreeslife.memorium', ['ngRoute', 'ngResource','uiGmapgoogle-maps']) .factory("Memorium", function($resource) { return $resource( "http://localhost:3000/memorium/", {'query': { method: 'GET' }} ); }) .controller("memoriumController", ['$scope', 'uiGmapGoogleMapApi', 'Memorium', '$interval', function($scope, GoogleMapApi, Memorium, $interval) { //$scope.lower = 1; //$scope.upper = 10; //$scope.current = $scope.lower; //$scope.direction = 1; //$scope.delay = 100; // //var stop; //$scope.blurrify = function() { // if ( angular.isDefined(stop) ) return; // stop = $interval(function() { // if ($scope.direction > 0 && $scope.current >= $scope.upper) { // $scope.direction = -1; // } else if ($scope.direction <= 0 && $scope.current <= $scope.lower) { // $scope.direction = 1; // } // $scope.current = $scope.current + $scope.direction; // $scope.atlFilter = 'blur('+scope.current+'px)'; // }, $scope.delay); $scope.map = { center: {latitude: 50.7179561, longitude: 4.6557242}, zoom: 8, events: { tilesloaded :function (map) { $scope.$apply(function () { $scope.mapInstance = map; //Memorium.query().$promise.then(function(data){ // angular.forEach(data, function(val, key) { // var item = val; // var location = new google.maps.LatLng( // parseFloat(item.location.latitude), // parseFloat(item.location.longitude)); // // var infowindow = new google.maps.InfoWindow({ // content: "<span>"+item.name+"</span>" // }); // // var marker = new google.maps.Marker({ // //id: item._id, // position: location, // title: item.name // }); // marker.setMap(map); // // google.maps.event.addListener(marker, 'click', function() { // infowindow.open(map,marker); // }); // }); //}); }); } } }; GoogleMapApi.then(function (maps) { console.info("Maps loaded"); }); }]) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/memorium', { templateUrl: '/memorium/memorium.html', controller: 'memoriumController' }); }]) .config(['uiGmapGoogleMapApiProvider', function(GoogleMapApi){ GoogleMapApi.configure({ china: false, key: 'AIzaSyDhLc1SkPF1mY9SZ7NX3yGeU7GciAyyUUA', v: '3.17', libraries: 'weather,geometry,visualization' }); }]);
var class_module_1_1_i_module = [ [ "Type", "class_module_1_1_i_module.html#acde96227fba125dc2c7f85e7675a05dc", [ [ "Core", "class_module_1_1_i_module.html#acde96227fba125dc2c7f85e7675a05dcaded95a52e1183dc0f93eba1fc18d379e", null ], [ "Logger", "class_module_1_1_i_module.html#acde96227fba125dc2c7f85e7675a05dcaea655268b741236b3bab7cb6e9eb7187", null ], [ "ConfigLoader", "class_module_1_1_i_module.html#acde96227fba125dc2c7f85e7675a05dca77fc1a7b352268a015f5b3a65abb2fe0", null ], [ "Network", "class_module_1_1_i_module.html#acde96227fba125dc2c7f85e7675a05dca8bf7c5ab141c5519ac1d45b6d023bd9f", null ], [ "FileServe", "class_module_1_1_i_module.html#acde96227fba125dc2c7f85e7675a05dca5020f807dd932d071f5953f9c09f79c4", null ], [ "HTTP", "class_module_1_1_i_module.html#acde96227fba125dc2c7f85e7675a05dca648a185e99db1fcf5511f617c69febd9", null ], [ "Default", "class_module_1_1_i_module.html#acde96227fba125dc2c7f85e7675a05dca8909b1af8238b905c50e1f9b5380a107", null ] ] ], [ "GetModule", "class_module_1_1_i_module.html#abd437fbc7fe8775dd40359b0d53136d8", null ], [ "GetName", "class_module_1_1_i_module.html#a9b6de41ae7fe493a7e93a2a7a36f7881", null ], [ "GetType", "class_module_1_1_i_module.html#af9b979fc3533cf3a70020d137556bdfd", null ], [ "Load", "class_module_1_1_i_module.html#a00f9bb99c5c9d6aa660f671f82611f16", null ], [ "Unload", "class_module_1_1_i_module.html#aede74af2aa24cb0c1744f5760e4cd75c", null ] ];
export { B as Behavior, V as CONTEXT, a5 as CUSTOM_UNITS, a3 as FLEX_GAP_SUPPORTED, O as NuAction, M as NuBase, L as Nude, a6 as ROOT_CONTEXT, a4 as STATES_MAP, a0 as assign, X as behaviors, T as contrast, c as deepQuery, d as deepQueryAll, L as default, $ as define, P as elements, Z as helpers, a2 as hue, I as icons, i as isEqual, U as reduceMotion, Y as requestIdleCallback, j as routing, Q as scheme, _ as styles, S as svg, a1 as units } from './index-16504bb3.js';
/*! Buefy v0.9.16 | MIT License | github.com/buefy/buefy */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = global || self, factory(global.Tooltip = {})); }(this, function (exports) { 'use strict'; function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; } else { _typeof = function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } var config = { defaultContainerElement: null, defaultIconPack: 'mdi', defaultIconComponent: null, defaultIconPrev: 'chevron-left', defaultIconNext: 'chevron-right', defaultLocale: undefined, defaultDialogConfirmText: null, defaultDialogCancelText: null, defaultSnackbarDuration: 3500, defaultSnackbarPosition: null, defaultToastDuration: 2000, defaultToastPosition: null, defaultNotificationDuration: 2000, defaultNotificationPosition: null, defaultTooltipType: 'is-primary', defaultTooltipDelay: null, defaultSidebarDelay: null, defaultInputAutocomplete: 'on', defaultDateFormatter: null, defaultDateParser: null, defaultDateCreator: null, defaultTimeCreator: null, defaultDayNames: null, defaultMonthNames: null, defaultFirstDayOfWeek: null, defaultUnselectableDaysOfWeek: null, defaultTimeFormatter: null, defaultTimeParser: null, defaultModalCanCancel: ['escape', 'x', 'outside', 'button'], defaultModalScroll: null, defaultDatepickerMobileNative: true, defaultTimepickerMobileNative: true, defaultNoticeQueue: true, defaultInputHasCounter: true, defaultTaginputHasCounter: true, defaultUseHtml5Validation: true, defaultDropdownMobileModal: true, defaultFieldLabelPosition: null, defaultDatepickerYearsRange: [-100, 10], defaultDatepickerNearbyMonthDays: true, defaultDatepickerNearbySelectableMonthDays: false, defaultDatepickerShowWeekNumber: false, defaultDatepickerWeekNumberClickable: false, defaultDatepickerMobileModal: true, defaultTrapFocus: true, defaultAutoFocus: true, defaultButtonRounded: false, defaultSwitchRounded: true, defaultCarouselInterval: 3500, defaultTabsExpanded: false, defaultTabsAnimated: true, defaultTabsType: null, defaultStatusIcon: true, defaultProgrammaticPromise: false, defaultLinkTags: ['a', 'button', 'input', 'router-link', 'nuxt-link', 'n-link', 'RouterLink', 'NuxtLink', 'NLink'], defaultImageWebpFallback: null, defaultImageLazy: true, defaultImageResponsive: true, defaultImageRatio: null, defaultImageSrcsetFormatter: null, defaultBreadcrumbTag: 'a', defaultBreadcrumbAlign: 'is-left', defaultBreadcrumbSeparator: '', defaultBreadcrumbSize: 'is-medium', customIconPacks: null }; function removeElement(el) { if (typeof el.remove !== 'undefined') { el.remove(); } else if (typeof el.parentNode !== 'undefined' && el.parentNode !== null) { el.parentNode.removeChild(el); } } function createAbsoluteElement(el) { var root = document.createElement('div'); root.style.position = 'absolute'; root.style.left = '0px'; root.style.top = '0px'; root.style.width = '100%'; var wrapper = document.createElement('div'); root.appendChild(wrapper); wrapper.appendChild(el); document.body.appendChild(root); return root; } var script = { name: 'BTooltip', props: { active: { type: Boolean, default: true }, type: { type: String, default: function _default() { return config.defaultTooltipType; } }, label: String, delay: { type: Number, default: function _default() { return config.defaultTooltipDelay; } }, position: { type: String, default: 'is-top', validator: function validator(value) { return ['is-top', 'is-bottom', 'is-left', 'is-right'].indexOf(value) > -1; } }, triggers: { type: Array, default: function _default() { return ['hover']; } }, always: Boolean, square: Boolean, dashed: Boolean, multilined: Boolean, size: { type: String, default: 'is-medium' }, appendToBody: Boolean, animated: { type: Boolean, default: true }, animation: { type: String, default: 'fade' }, contentClass: String, autoClose: { type: [Array, Boolean], default: true } }, data: function data() { return { isActive: false, triggerStyle: {}, timer: null, _bodyEl: undefined // Used to append to body }; }, computed: { rootClasses: function rootClasses() { return ['b-tooltip', this.type, this.position, this.size, { 'is-square': this.square, 'is-always': this.always, 'is-multiline': this.multilined, 'is-dashed': this.dashed }]; }, newAnimation: function newAnimation() { return this.animated ? this.animation : undefined; } }, watch: { isActive: function isActive(value) { if (this.appendToBody) { this.updateAppendToBody(); } } }, methods: { updateAppendToBody: function updateAppendToBody() { var tooltip = this.$refs.tooltip; var trigger = this.$refs.trigger; if (tooltip && trigger) { // update wrapper tooltip var tooltipEl = this.$data._bodyEl.children[0]; tooltipEl.classList.forEach(function (item) { return tooltipEl.classList.remove(item); }); if (this.$vnode && this.$vnode.data && this.$vnode.data.staticClass) { tooltipEl.classList.add(this.$vnode.data.staticClass); } this.rootClasses.forEach(function (item) { if (_typeof(item) === 'object') { for (var key in item) { if (item[key]) { tooltipEl.classList.add(key); } } } else { tooltipEl.classList.add(item); } }); tooltipEl.style.width = "".concat(trigger.clientWidth, "px"); tooltipEl.style.height = "".concat(trigger.clientHeight, "px"); var rect = trigger.getBoundingClientRect(); var top = rect.top + window.scrollY; var left = rect.left + window.scrollX; var wrapper = this.$data._bodyEl; wrapper.style.position = 'absolute'; wrapper.style.top = "".concat(top, "px"); wrapper.style.left = "".concat(left, "px"); wrapper.style.zIndex = this.isActive || this.always ? '99' : '-1'; this.triggerStyle = { zIndex: this.isActive || this.always ? '100' : undefined }; } }, onClick: function onClick() { var _this = this; if (this.triggers.indexOf('click') < 0) return; // if not active, toggle after clickOutside event // this fixes toggling programmatic this.$nextTick(function () { setTimeout(function () { return _this.open(); }); }); }, onHover: function onHover() { if (this.triggers.indexOf('hover') < 0) return; this.open(); }, onContextMenu: function onContextMenu(e) { if (this.triggers.indexOf('contextmenu') < 0) return; e.preventDefault(); this.open(); }, onFocus: function onFocus() { if (this.triggers.indexOf('focus') < 0) return; this.open(); }, open: function open() { var _this2 = this; if (this.delay) { this.timer = setTimeout(function () { _this2.isActive = true; _this2.timer = null; }, this.delay); } else { this.isActive = true; } }, close: function close() { if (typeof this.autoClose === 'boolean') { this.isActive = !this.autoClose; if (this.autoClose && this.timer) clearTimeout(this.timer); } }, /** * Close tooltip if clicked outside. */ clickedOutside: function clickedOutside(event) { if (this.isActive) { if (Array.isArray(this.autoClose)) { if (this.autoClose.includes('outside')) { if (!this.isInWhiteList(event.target)) { this.isActive = false; return; } } if (this.autoClose.includes('inside')) { if (this.isInWhiteList(event.target)) this.isActive = false; } } } }, /** * Keypress event that is bound to the document */ keyPress: function keyPress(_ref) { var key = _ref.key; if (this.isActive && (key === 'Escape' || key === 'Esc')) { if (Array.isArray(this.autoClose)) { if (this.autoClose.indexOf('escape') >= 0) this.isActive = false; } } }, /** * White-listed items to not close when clicked. */ isInWhiteList: function isInWhiteList(el) { if (el === this.$refs.content) return true; // All chidren from content if (this.$refs.content !== undefined) { var children = this.$refs.content.querySelectorAll('*'); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var child = _step.value; if (el === child) { return true; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } return false; } }, mounted: function mounted() { if (this.appendToBody && typeof window !== 'undefined') { this.$data._bodyEl = createAbsoluteElement(this.$refs.content); this.updateAppendToBody(); } }, created: function created() { if (typeof window !== 'undefined') { document.addEventListener('click', this.clickedOutside); document.addEventListener('keyup', this.keyPress); } }, beforeDestroy: function beforeDestroy() { if (typeof window !== 'undefined') { document.removeEventListener('click', this.clickedOutside); document.removeEventListener('keyup', this.keyPress); } if (this.appendToBody) { removeElement(this.$data._bodyEl); } } }; function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */ , shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { if (typeof shadowMode !== 'boolean') { createInjectorSSR = createInjector; createInjector = shadowMode; shadowMode = false; } // Vue.extend constructor export interop. var options = typeof script === 'function' ? script.options : script; // render functions if (template && template.render) { options.render = template.render; options.staticRenderFns = template.staticRenderFns; options._compiled = true; // functional template if (isFunctionalTemplate) { options.functional = true; } } // scopedId if (scopeId) { options._scopeId = scopeId; } var hook; if (moduleIdentifier) { // server build hook = function hook(context) { // 2.3 injection context = context || // cached call this.$vnode && this.$vnode.ssrContext || // stateful this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__; } // inject component styles if (style) { style.call(this, createInjectorSSR(context)); } // register component module identifier for async chunk inference if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier); } }; // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook; } else if (style) { hook = shadowMode ? function () { style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); } : function (context) { style.call(this, createInjector(context)); }; } if (hook) { if (options.functional) { // register for functional component in vue file var originalRender = options.render; options.render = function renderWithStyleInjection(h, context) { hook.call(context); return originalRender(h, context); }; } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate; options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; } } return script; } var normalizeComponent_1 = normalizeComponent; /* script */ const __vue_script__ = script; /* template */ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"tooltip",class:_vm.rootClasses},[_c('transition',{attrs:{"name":_vm.newAnimation}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.active && (_vm.isActive || _vm.always)),expression:"active && (isActive || always)"}],ref:"content",class:['tooltip-content', _vm.contentClass]},[(_vm.label)?[_vm._v(_vm._s(_vm.label))]:(_vm.$slots.content)?[_vm._t("content")]:_vm._e()],2)]),_c('div',{ref:"trigger",staticClass:"tooltip-trigger",style:(_vm.triggerStyle),on:{"click":_vm.onClick,"contextmenu":_vm.onContextMenu,"mouseenter":_vm.onHover,"!focus":function($event){return _vm.onFocus($event)},"!blur":function($event){return _vm.close($event)},"mouseleave":_vm.close}},[_vm._t("default")],2)],1)}; var __vue_staticRenderFns__ = []; /* style */ const __vue_inject_styles__ = undefined; /* scoped */ const __vue_scope_id__ = undefined; /* module identifier */ const __vue_module_identifier__ = undefined; /* functional template */ const __vue_is_functional_template__ = false; /* style inject */ /* style inject SSR */ var Tooltip = normalizeComponent_1( { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined ); var use = function use(plugin) { if (typeof window !== 'undefined' && window.Vue) { window.Vue.use(plugin); } }; var registerComponent = function registerComponent(Vue, component) { Vue.component(component.name, component); }; var Plugin = { install: function install(Vue) { registerComponent(Vue, Tooltip); } }; use(Plugin); exports.BTooltip = Tooltip; exports.default = Plugin; Object.defineProperty(exports, '__esModule', { value: true }); }));
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gulp-tasks/cldr/extract.js (function(global) { global.ng = global.ng || {}; global.ng.common = global.ng.common || {}; global.ng.common.locales = global.ng.common.locales || {}; const u = undefined; function plural(n) { let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length; if (i === 1 && v === 0) return 1; return 5; } root.ng.common.locales['en-kn'] = [ 'en-KN', [['a', 'p'], ['am', 'pm'], u], [['am', 'pm'], u, u], [ ['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] ], u, [ ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'], ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ] ], u, [['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']], 1, [6, 0], ['dd/MM/y', 'd MMM y', 'd MMMM y', 'EEEE, d MMMM y'], ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'], ['{1}, {0}', u, '{1} \'at\' {0}', u], ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'], ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], '$', 'East Caribbean Dollar', {'JPY': ['JP¥', '¥'], 'USD': ['US$', '$'], 'XCD': ['$']}, plural, [ [ ['mi', 'n', 'in the morning', 'in the afternoon', 'in the evening', 'at night'], ['midnight', 'noon', 'in the morning', 'in the afternoon', 'in the evening', 'at night'], u ], [['midnight', 'noon', 'morning', 'afternoon', 'evening', 'night'], u, u], [ '00:00', '12:00', ['06:00', '12:00'], ['12:00', '18:00'], ['18:00', '21:00'], ['21:00', '06:00'] ] ] ]; })(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global || typeof window !== 'undefined' && window);
'use strict'; module.exports = Controller => class extends Controller { middlewareSetup() { super.middlewareSetup(); // This is used as early as possible so the base URL can be used in error pages this.use(this.setBaseUrlLocal); } setBaseUrlLocal(req, res, next) { res.locals.baseUrl = req.baseUrl; next(); } };
/** * A utility class to help make it easier to access the data stores * @extends {Map} */ class Collection extends Map { /** * Returns an ordered array of the values of this collection. * @returns {array} * @example * // identical to: * Array.from(collection.values()); */ array() { return Array.from(this.values()); } /** * Returns the first item in this collection. * @returns {*} * @example * // identical to: * Array.from(collection.values())[0]; */ first() { return this.values().next().value; } /** * Returns the last item in this collection. This is a relatively slow operation, * since an array copy of the values must be made to find the last element. * @returns {*} */ last() { const arr = this.array(); return arr[arr.length - 1]; } /** * Returns a random item from this collection. This is a relatively slow operation, * since an array copy of the values must be made to find a random element. * @returns {*} */ random() { const arr = this.array(); return arr[Math.floor(Math.random() * arr.length)]; } /** * If the items in this collection have a delete method (e.g. messages), invoke * the delete method. Returns an array of promises * @returns {Promise[]} */ deleteAll() { const returns = []; for (const item of this.values()) { if (item.delete) returns.push(item.delete()); } return returns; } /** * Returns an array of items where `item[key] === value` of the collection * @param {string} key The key to filter by * @param {*} value The expected value * @returns {array} * @example * collection.findAll('username', 'Bob'); */ findAll(key, value) { if (typeof key !== 'string') throw new TypeError('key must be a string'); if (typeof value === 'undefined') throw new Error('value must be specified'); const results = []; for (const item of this.values()) { if (item[key] === value) results.push(item); } return results; } /** * Returns a single item where `item[key] === value` * @param {string} key The key to filter by * @param {*} value The expected value * @returns {*} * @example * collection.find('id', '123123...'); */ find(key, value) { if (typeof key !== 'string') throw new TypeError('key must be a string'); if (typeof value === 'undefined') throw new Error('value must be specified'); for (const item of this.values()) { if (item[key] === value) return item; } return null; } /** * Returns true if the collection has an item where `item[key] === value` * @param {string} key The key to filter by * @param {*} value The expected value * @returns {boolean} * @example * if (collection.exists('id', '123123...')) { * console.log('user here!'); * } */ exists(key, value) { return Boolean(this.find(key, value)); } /** * Identical to * [Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter), * but returns a Collection instead of an Array. * @param {function} fn Function used to test (should return a boolean) * @param {Object} [thisArg] Value to use as `this` when executing function * @returns {Collection} */ filter(fn, thisArg) { if (thisArg) fn = fn.bind(thisArg); const collection = new Collection(); for (const [key, val] of this) { if (fn(val, key, this)) collection.set(key, val); } return collection; } /** * Identical to * [Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). * @param {function} fn Function that produces an element of the new array, taking three arguments * @param {*} [thisArg] Value to use as `this` when executing function * @returns {array} */ map(fn, thisArg) { if (thisArg) fn = fn.bind(thisArg); const arr = new Array(this.size); let i = 0; for (const [key, val] of this) { arr[i++] = fn(val, key, this); } return arr; } /** * Identical to * [Array.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some). * @param {function} fn Function used to test (should return a boolean) * @param {Object} [thisArg] Value to use as `this` when executing function * @returns {Collection} */ some(fn, thisArg) { if (thisArg) fn = fn.bind(thisArg); for (const [key, val] of this) { if (fn(val, key, this)) return true; } return false; } /** * Identical to * [Array.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every). * @param {function} fn Function used to test (should return a boolean) * @param {Object} [thisArg] Value to use as `this` when executing function * @returns {Collection} */ every(fn, thisArg) { if (thisArg) fn = fn.bind(thisArg); for (const [key, val] of this) { if (!fn(val, key, this)) return false; } return true; } } module.exports = Collection;
"use strict"; // https://mithril.js.org/change-log.html#mdeferred-removed // Add a warning above any usage of `m.deferred()` module.exports = (file, api) => { var j = api.jscodeshift, s = api.stats; return j(file.source) .find(j.CallExpression, { callee : { object : { name : "m" }, property : { name : "deferred" } } }) .forEach(() => s("m.deferred")) .replaceWith((p) => j.template.expression` console.warn("m.deferred has been removed from mithril 1.0") || ${p.value} `) .toSource(); };
/* Unobtrusive JavaScript https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts Released under the MIT license */; (function() { var context = this; (function() { (function() { this.Rails = { linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]', buttonClickSelector: { selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])', exclude: 'form button' }, inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', formSubmitSelector: 'form', formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])', formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled', formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled', fileInputSelector: 'input[name][type=file]:not([disabled])', linkDisableSelector: 'a[data-disable-with], a[data-disable]', buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]' }; }).call(this); }).call(context); var Rails = context.Rails; (function() { (function() { var nonce; nonce = null; Rails.loadCSPNonce = function() { var ref; return nonce = (ref = document.querySelector("meta[name=csp-nonce]")) != null ? ref.content : void 0; }; Rails.cspNonce = function() { return nonce != null ? nonce : Rails.loadCSPNonce(); }; }).call(this); (function() { var expando, m; m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector; Rails.matches = function(element, selector) { if (selector.exclude != null) { return m.call(element, selector.selector) && !m.call(element, selector.exclude); } else { return m.call(element, selector); } }; expando = '_ujsData'; Rails.getData = function(element, key) { var ref; return (ref = element[expando]) != null ? ref[key] : void 0; }; Rails.setData = function(element, key, value) { if (element[expando] == null) { element[expando] = {}; } return element[expando][key] = value; }; Rails.$ = function(selector) { return Array.prototype.slice.call(document.querySelectorAll(selector)); }; }).call(this); (function() { var $, csrfParam, csrfToken; $ = Rails.$; csrfToken = Rails.csrfToken = function() { var meta; meta = document.querySelector('meta[name=csrf-token]'); return meta && meta.content; }; csrfParam = Rails.csrfParam = function() { var meta; meta = document.querySelector('meta[name=csrf-param]'); return meta && meta.content; }; Rails.CSRFProtection = function(xhr) { var token; token = csrfToken(); if (token != null) { return xhr.setRequestHeader('X-CSRF-Token', token); } }; Rails.refreshCSRFTokens = function() { var param, token; token = csrfToken(); param = csrfParam(); if ((token != null) && (param != null)) { return $('form input[name="' + param + '"]').forEach(function(input) { return input.value = token; }); } }; }).call(this); (function() { var CustomEvent, fire, matches, preventDefault; matches = Rails.matches; CustomEvent = window.CustomEvent; if (typeof CustomEvent !== 'function') { CustomEvent = function(event, params) { var evt; evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; }; CustomEvent.prototype = window.Event.prototype; preventDefault = CustomEvent.prototype.preventDefault; CustomEvent.prototype.preventDefault = function() { var result; result = preventDefault.call(this); if (this.cancelable && !this.defaultPrevented) { Object.defineProperty(this, 'defaultPrevented', { get: function() { return true; } }); } return result; }; } fire = Rails.fire = function(obj, name, data) { var event; event = new CustomEvent(name, { bubbles: true, cancelable: true, detail: data }); obj.dispatchEvent(event); return !event.defaultPrevented; }; Rails.stopEverything = function(e) { fire(e.target, 'ujs:everythingStopped'); e.preventDefault(); e.stopPropagation(); return e.stopImmediatePropagation(); }; Rails.delegate = function(element, selector, eventType, handler) { return element.addEventListener(eventType, function(e) { var target; target = e.target; while (!(!(target instanceof Element) || matches(target, selector))) { target = target.parentNode; } if (target instanceof Element && handler.call(target, e) === false) { e.preventDefault(); return e.stopPropagation(); } }); }; }).call(this); (function() { var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse; cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire; AcceptHeaders = { '*': '*/*', text: 'text/plain', html: 'text/html', xml: 'application/xml, text/xml', json: 'application/json, text/javascript', script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript' }; Rails.ajax = function(options) { var xhr; options = prepareOptions(options); xhr = createXHR(options, function() { var ref, response; response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type')); if (Math.floor(xhr.status / 100) === 2) { if (typeof options.success === "function") { options.success(response, xhr.statusText, xhr); } } else { if (typeof options.error === "function") { options.error(response, xhr.statusText, xhr); } } return typeof options.complete === "function" ? options.complete(xhr, xhr.statusText) : void 0; }); if ((options.beforeSend != null) && !options.beforeSend(xhr, options)) { return false; } if (xhr.readyState === XMLHttpRequest.OPENED) { return xhr.send(options.data); } }; prepareOptions = function(options) { options.url = options.url || location.href; options.type = options.type.toUpperCase(); if (options.type === 'GET' && options.data) { if (options.url.indexOf('?') < 0) { options.url += '?' + options.data; } else { options.url += '&' + options.data; } } if (AcceptHeaders[options.dataType] == null) { options.dataType = '*'; } options.accept = AcceptHeaders[options.dataType]; if (options.dataType !== '*') { options.accept += ', */*; q=0.01'; } return options; }; createXHR = function(options, done) { var xhr; xhr = new XMLHttpRequest(); xhr.open(options.type, options.url, true); xhr.setRequestHeader('Accept', options.accept); if (typeof options.data === 'string') { xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); } if (!options.crossDomain) { xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); CSRFProtection(xhr); } xhr.withCredentials = !!options.withCredentials; xhr.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) { return done(xhr); } }; return xhr; }; processResponse = function(response, type) { var parser, script; if (typeof response === 'string' && typeof type === 'string') { if (type.match(/\bjson\b/)) { try { response = JSON.parse(response); } catch (error) {} } else if (type.match(/\b(?:java|ecma)script\b/)) { script = document.createElement('script'); script.setAttribute('nonce', cspNonce()); script.text = response; document.head.appendChild(script).parentNode.removeChild(script); } else if (type.match(/\b(xml|html|svg)\b/)) { parser = new DOMParser(); type = type.replace(/;.+/, ''); try { response = parser.parseFromString(response, type); } catch (error) {} } } return response; }; Rails.href = function(element) { return element.href; }; Rails.isCrossDomain = function(url) { var e, originAnchor, urlAnchor; originAnchor = document.createElement('a'); originAnchor.href = location.href; urlAnchor = document.createElement('a'); try { urlAnchor.href = url; return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || (originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host)); } catch (error) { e = error; return true; } }; }).call(this); (function() { var matches, toArray; matches = Rails.matches; toArray = function(e) { return Array.prototype.slice.call(e); }; Rails.serializeElement = function(element, additionalParam) { var inputs, params; inputs = [element]; if (matches(element, 'form')) { inputs = toArray(element.elements); } params = []; inputs.forEach(function(input) { if (!input.name || input.disabled) { return; } if (matches(input, 'fieldset[disabled] *')) { return; } if (matches(input, 'select')) { return toArray(input.options).forEach(function(option) { if (option.selected) { return params.push({ name: input.name, value: option.value }); } }); } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) { return params.push({ name: input.name, value: input.value }); } }); if (additionalParam) { params.push(additionalParam); } return params.map(function(param) { if (param.name != null) { return (encodeURIComponent(param.name)) + "=" + (encodeURIComponent(param.value)); } else { return param; } }).join('&'); }; Rails.formElements = function(form, selector) { if (matches(form, 'form')) { return toArray(form.elements).filter(function(el) { return matches(el, selector); }); } else { return toArray(form.querySelectorAll(selector)); } }; }).call(this); (function() { var allowAction, fire, stopEverything; fire = Rails.fire, stopEverything = Rails.stopEverything; Rails.handleConfirm = function(e) { if (!allowAction(this)) { return stopEverything(e); } }; Rails.confirm = function(message, element) { return confirm(message); }; allowAction = function(element) { var answer, callback, message; message = element.getAttribute('data-confirm'); if (!message) { return true; } answer = false; if (fire(element, 'confirm')) { try { answer = Rails.confirm(message, element); } catch (error) {} callback = fire(element, 'confirm:complete', [answer]); } return answer && callback; }; }).call(this); (function() { var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything; matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements; Rails.handleDisabledElement = function(e) { var element; element = this; if (element.disabled) { return stopEverything(e); } }; Rails.enableElement = function(e) { var element; if (e instanceof Event) { if (isXhrRedirect(e)) { return; } element = e.target; } else { element = e; } if (matches(element, Rails.linkDisableSelector)) { return enableLinkElement(element); } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) { return enableFormElement(element); } else if (matches(element, Rails.formSubmitSelector)) { return enableFormElements(element); } }; Rails.disableElement = function(e) { var element; element = e instanceof Event ? e.target : e; if (matches(element, Rails.linkDisableSelector)) { return disableLinkElement(element); } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) { return disableFormElement(element); } else if (matches(element, Rails.formSubmitSelector)) { return disableFormElements(element); } }; disableLinkElement = function(element) { var replacement; if (getData(element, 'ujs:disabled')) { return; } replacement = element.getAttribute('data-disable-with'); if (replacement != null) { setData(element, 'ujs:enable-with', element.innerHTML); element.innerHTML = replacement; } element.addEventListener('click', stopEverything); return setData(element, 'ujs:disabled', true); }; enableLinkElement = function(element) { var originalText; originalText = getData(element, 'ujs:enable-with'); if (originalText != null) { element.innerHTML = originalText; setData(element, 'ujs:enable-with', null); } element.removeEventListener('click', stopEverything); return setData(element, 'ujs:disabled', null); }; disableFormElements = function(form) { return formElements(form, Rails.formDisableSelector).forEach(disableFormElement); }; disableFormElement = function(element) { var replacement; if (getData(element, 'ujs:disabled')) { return; } replacement = element.getAttribute('data-disable-with'); if (replacement != null) { if (matches(element, 'button')) { setData(element, 'ujs:enable-with', element.innerHTML); element.innerHTML = replacement; } else { setData(element, 'ujs:enable-with', element.value); element.value = replacement; } } element.disabled = true; return setData(element, 'ujs:disabled', true); }; enableFormElements = function(form) { return formElements(form, Rails.formEnableSelector).forEach(enableFormElement); }; enableFormElement = function(element) { var originalText; originalText = getData(element, 'ujs:enable-with'); if (originalText != null) { if (matches(element, 'button')) { element.innerHTML = originalText; } else { element.value = originalText; } setData(element, 'ujs:enable-with', null); } element.disabled = false; return setData(element, 'ujs:disabled', null); }; isXhrRedirect = function(event) { var ref, xhr; xhr = (ref = event.detail) != null ? ref[0] : void 0; return (xhr != null ? xhr.getResponseHeader("X-Xhr-Redirect") : void 0) != null; }; }).call(this); (function() { var stopEverything; stopEverything = Rails.stopEverything; Rails.handleMethod = function(e) { var csrfParam, csrfToken, form, formContent, href, link, method; link = this; method = link.getAttribute('data-method'); if (!method) { return; } href = Rails.href(link); csrfToken = Rails.csrfToken(); csrfParam = Rails.csrfParam(); form = document.createElement('form'); formContent = "<input name='_method' value='" + method + "' type='hidden' />"; if ((csrfParam != null) && (csrfToken != null) && !Rails.isCrossDomain(href)) { formContent += "<input name='" + csrfParam + "' value='" + csrfToken + "' type='hidden' />"; } formContent += '<input type="submit" />'; form.method = 'post'; form.action = href; form.target = link.target; form.innerHTML = formContent; form.style.display = 'none'; document.body.appendChild(form); form.querySelector('[type="submit"]').click(); return stopEverything(e); }; }).call(this); (function() { var ajax, fire, getData, isCrossDomain, isRemote, matches, serializeElement, setData, stopEverything, slice = [].slice; matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement; isRemote = function(element) { var value; value = element.getAttribute('data-remote'); return (value != null) && value !== 'false'; }; Rails.handleRemote = function(e) { var button, data, dataType, element, method, url, withCredentials; element = this; if (!isRemote(element)) { return true; } if (!fire(element, 'ajax:before')) { fire(element, 'ajax:stopped'); return false; } withCredentials = element.getAttribute('data-with-credentials'); dataType = element.getAttribute('data-type') || 'script'; if (matches(element, Rails.formSubmitSelector)) { button = getData(element, 'ujs:submit-button'); method = getData(element, 'ujs:submit-button-formmethod') || element.method; url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href; if (method.toUpperCase() === 'GET') { url = url.replace(/\?.*$/, ''); } if (element.enctype === 'multipart/form-data') { data = new FormData(element); if (button != null) { data.append(button.name, button.value); } } else { data = serializeElement(element, button); } setData(element, 'ujs:submit-button', null); setData(element, 'ujs:submit-button-formmethod', null); setData(element, 'ujs:submit-button-formaction', null); } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) { method = element.getAttribute('data-method'); url = element.getAttribute('data-url'); data = serializeElement(element, element.getAttribute('data-params')); } else { method = element.getAttribute('data-method'); url = Rails.href(element); data = element.getAttribute('data-params'); } ajax({ type: method || 'GET', url: url, data: data, dataType: dataType, beforeSend: function(xhr, options) { if (fire(element, 'ajax:beforeSend', [xhr, options])) { return fire(element, 'ajax:send', [xhr]); } else { fire(element, 'ajax:stopped'); return false; } }, success: function() { var args; args = 1 <= arguments.length ? slice.call(arguments, 0) : []; return fire(element, 'ajax:success', args); }, error: function() { var args; args = 1 <= arguments.length ? slice.call(arguments, 0) : []; return fire(element, 'ajax:error', args); }, complete: function() { var args; args = 1 <= arguments.length ? slice.call(arguments, 0) : []; return fire(element, 'ajax:complete', args); }, crossDomain: isCrossDomain(url), withCredentials: (withCredentials != null) && withCredentials !== 'false' }); return stopEverything(e); }; Rails.formSubmitButtonClick = function(e) { var button, form; button = this; form = button.form; if (!form) { return; } if (button.name) { setData(form, 'ujs:submit-button', { name: button.name, value: button.value }); } setData(form, 'ujs:formnovalidate-button', button.formNoValidate); setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction')); return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod')); }; Rails.preventInsignificantClick = function(e) { var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick; link = this; method = (link.getAttribute('data-method') || 'GET').toUpperCase(); data = link.getAttribute('data-params'); metaClick = e.metaKey || e.ctrlKey; insignificantMetaClick = metaClick && method === 'GET' && !data; nonPrimaryMouseClick = (e.button != null) && e.button !== 0; if (nonPrimaryMouseClick || insignificantMetaClick) { return e.stopImmediatePropagation(); } }; }).call(this); (function() { var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens; fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod; if ((typeof jQuery !== "undefined" && jQuery !== null) && (jQuery.ajax != null)) { if (jQuery.rails) { throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.'); } jQuery.rails = Rails; jQuery.ajaxPrefilter(function(options, originalOptions, xhr) { if (!options.crossDomain) { return CSRFProtection(xhr); } }); } Rails.start = function() { if (window._rails_loaded) { throw new Error('rails-ujs has already been loaded!'); } window.addEventListener('pageshow', function() { $(Rails.formEnableSelector).forEach(function(el) { if (getData(el, 'ujs:disabled')) { return enableElement(el); } }); return $(Rails.linkDisableSelector).forEach(function(el) { if (getData(el, 'ujs:disabled')) { return enableElement(el); } }); }); delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement); delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement); delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement); delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement); delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick); delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement); delegate(document, Rails.linkClickSelector, 'click', handleConfirm); delegate(document, Rails.linkClickSelector, 'click', disableElement); delegate(document, Rails.linkClickSelector, 'click', handleRemote); delegate(document, Rails.linkClickSelector, 'click', handleMethod); delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick); delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement); delegate(document, Rails.buttonClickSelector, 'click', handleConfirm); delegate(document, Rails.buttonClickSelector, 'click', disableElement); delegate(document, Rails.buttonClickSelector, 'click', handleRemote); delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement); delegate(document, Rails.inputChangeSelector, 'change', handleConfirm); delegate(document, Rails.inputChangeSelector, 'change', handleRemote); delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement); delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm); delegate(document, Rails.formSubmitSelector, 'submit', handleRemote); delegate(document, Rails.formSubmitSelector, 'submit', function(e) { return setTimeout((function() { return disableElement(e); }), 13); }); delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement); delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement); delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick); delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement); delegate(document, Rails.formInputClickSelector, 'click', handleConfirm); delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick); document.addEventListener('DOMContentLoaded', refreshCSRFTokens); document.addEventListener('DOMContentLoaded', loadCSPNonce); return window._rails_loaded = true; }; if (window.Rails === Rails && fire(document, 'rails:attachBindings')) { Rails.start(); } }).call(this); }).call(this); if (typeof module === "object" && module.exports) { module.exports = Rails; } else if (typeof define === "function" && define.amd) { define(Rails); } }).call(this); // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. // // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. //;
/* Highcharts JS v9.2.2 (2021-08-24) Client side exporting module (c) 2015-2021 Torstein Honsi / Oystein Moseng License: www.highcharts.com/license */ 'use strict';(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/offline-exporting",["highcharts","highcharts/modules/exporting"],function(k){a(k);a.Highcharts=k;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function k(a,t,d,r){a.hasOwnProperty(t)||(a[t]=r.apply(null,d))}a=a?a._modules:{};k(a,"Extensions/DownloadURL.js",[a["Core/Globals.js"]],function(a){var t=a.isSafari, d=a.win,r=d.document,l=d.URL||d.webkitURL||d,k=a.dataURLtoBlob=function(a){if((a=a.replace(/filename=.*;/,"").match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/))&&3<a.length&&d.atob&&d.ArrayBuffer&&d.Uint8Array&&d.Blob&&l.createObjectURL){var e=d.atob(a[3]),m=new d.ArrayBuffer(e.length);m=new d.Uint8Array(m);for(var b=0;b<m.length;++b)m[b]=e.charCodeAt(b);a=new d.Blob([m],{type:a[1]});return l.createObjectURL(a)}};a=a.downloadURL=function(a,l){var m=d.navigator,b=r.createElement("a");if("string"=== typeof a||a instanceof String||!m.msSaveOrOpenBlob){a=""+a;m=/Edge\/\d+/.test(m.userAgent);if(t&&"string"===typeof a&&0===a.indexOf("data:application/pdf")||m||2E6<a.length)if(a=k(a)||"",!a)throw Error("Failed to convert to blob");if("undefined"!==typeof b.download)b.href=a,b.download=l,r.body.appendChild(b),b.click(),r.body.removeChild(b);else try{var e=d.open(a,"chart");if("undefined"===typeof e||null===e)throw Error("Failed to open window");}catch(L){d.location.href=a}}else m.msSaveOrOpenBlob(a, l)};return{dataURLtoBlob:k,downloadURL:a}});k(a,"Extensions/OfflineExporting/OfflineExportingDefaults.js",[],function(){return{libURL:"https://code.highcharts.com/9.2.2/lib/",menuItemDefinitions:{downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChartLocal()}},downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChartLocal({type:"image/jpeg"})}},downloadSVG:{textKey:"downloadSVG",onclick:function(){this.exportChartLocal({type:"image/svg+xml"})}},downloadPDF:{textKey:"downloadPDF", onclick:function(){this.exportChartLocal({type:"application/pdf"})}}}}});k(a,"Extensions/OfflineExporting/OfflineExporting.js",[a["Core/Chart/Chart.js"],a["Core/DefaultOptions.js"],a["Extensions/DownloadURL.js"],a["Extensions/Exporting/Exporting.js"],a["Core/Globals.js"],a["Extensions/OfflineExporting/OfflineExportingDefaults.js"],a["Core/Utilities.js"]],function(a,k,d,r,l,H,e){var t=k.defaultOptions,m=d.downloadURL,b=l.win,x=l.doc,z=e.addEvent,y=e.error,I=e.extend,J=e.fireEvent,C=e.merge,D=[],v; (function(a){function d(f,g){var h=this,c=C(h.options.exporting,f),b=function(a){!1===c.fallbackToExportServer?c.error?c.error(c,a):y(28,!0):h.exportChart(c)};f=function(){return[].some.call(h.container.getElementsByTagName("image"),function(a){a=a.getAttribute("href");return""!==a&&0!==a.indexOf("data:")})};l.isMS&&h.styledMode&&!r.inlineWhitelist.length&&r.inlineWhitelist.push(/^blockSize/,/^border/,/^caretColor/,/^color/,/^columnRule/,/^columnRuleColor/,/^cssFloat/,/^cursor/,/^fill$/,/^fillOpacity/, /^font/,/^inlineSize/,/^length/,/^lineHeight/,/^opacity/,/^outline/,/^parentRule/,/^rx$/,/^ry$/,/^stroke/,/^textAlign/,/^textAnchor/,/^textDecoration/,/^transform/,/^vectorEffect/,/^visibility/,/^x$/,/^y$/);l.isMS&&("application/pdf"===c.type||h.container.getElementsByTagName("image").length&&"image/svg+xml"!==c.type)||"application/pdf"===c.type&&f()?b("Image type not supported for this chart/browser."):h.getSVGForLocalExport(c,g||{},b,function(f){-1<f.indexOf("<foreignObject")&&"image/svg+xml"!== c.type&&(l.isMS||"application/pdf"===c.type)?b("Image type not supportedfor charts with embedded HTML"):a.downloadSVGLocal(f,I({filename:h.getFilename()},c),b,function(){return J(h,"exportChartLocalSuccess")})})}function k(a,g){var f=x.getElementsByTagName("head")[0],c=x.createElement("script");c.type="text/javascript";c.src=a;c.onload=g;c.onerror=function(){y("Error loading script "+a)};f.appendChild(c)}function e(f,g,h,c){var b=this,d=function(){e&&q===e.length&&c(b.sanitizeSVG(p.innerHTML,n))}, k=function(a,f,c){++q;c.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",a);d()},m,p,n,l=null,e,q=0;b.unbindGetSVG=z(b,"getSVG",function(a){n=a.chartCopy.options;e=(p=a.chartCopy.container.cloneNode(!0))&&p.getElementsByTagName("image")||[]});b.getSVGForExport(f,g);try{if(!e||!e.length){c(b.sanitizeSVG(p.innerHTML,n));return}var w=0;for(m=e.length;w<m;++w){var u=e[w];(l=u.getAttributeNS("http://www.w3.org/1999/xlink","href"))?a.imageToDataUrl(l,"image/png",{imageElement:u},f.scale, k,h,h,h):(++q,u.parentNode.removeChild(u),d())}}catch(A){h(A)}b.unbindGetSVG()}function v(f,g,h,c,d,e,k,m,p){var n=new b.Image,l=function(){setTimeout(function(){var a=x.createElement("canvas"),b=a.getContext&&a.getContext("2d");try{if(b){a.height=n.height*c;a.width=n.width*c;b.drawImage(n,0,0,a.width,a.height);try{var e=a.toDataURL(g);d(e,g,h,c)}catch(F){q(f,g,h,c)}}else k(f,g,h,c)}finally{p&&p(f,g,h,c)}},a.loadEventDeferDelay)},E=function(){m(f,g,h,c);p&&p(f,g,h,c)};var q=function(){n=new b.Image; q=e;n.crossOrigin="Anonymous";n.onload=l;n.onerror=E;n.src=f};n.onload=l;n.onerror=E;n.src=f}function B(f){var g=b.navigator.userAgent;g=-1<g.indexOf("WebKit")&&0>g.indexOf("Chrome");try{if(!g&&!l.isFirefox&&-1===f.indexOf("<foreignObject"))return a.domurl.createObjectURL(new b.Blob([f],{type:"image/svg+xml;charset-utf-16"}))}catch(h){}return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(f)}function G(a,g){var f=a.width.baseVal.value+2*g;g=a.height.baseVal.value+2*g;f=new b.jsPDF(g>f?"p": "l","pt",[f,g]);[].forEach.call(a.querySelectorAll('*[visibility="hidden"]'),function(a){a.parentNode.removeChild(a)});g=a.querySelectorAll("linearGradient");for(var c=0;c<g.length;c++)for(var d=g[c].querySelectorAll("stop"),e=0;e<d.length&&"0"===d[e].getAttribute("offset")&&"0"===d[e+1].getAttribute("offset");)d[e].remove(),e++;[].forEach.call(a.querySelectorAll("tspan"),function(a){"\u200b"===a.textContent&&(a.textContent=" ",a.setAttribute("dx",-5))});b.svg2pdf(a,f,{removeInvalid:!0});return f.output("datauristring")} a.CanVGRenderer={};a.domurl=b.URL||b.webkitURL||b;a.loadEventDeferDelay=l.isMS?150:0;a.compose=function(a){if(-1===D.indexOf(a)){D.push(a);var b=a.prototype;b.getSVGForLocalExport=e;b.exportChartLocal=d;C(!0,t.exporting,H)}return a};a.downloadSVGLocal=function(f,g,d,c){var e=x.createElement("div"),h=g.type||"image/png",l=(g.filename||"chart")+"."+("image/svg+xml"===h?"svg":h.split("/")[1]),r=g.scale||1,p=g.libURL||t.exporting.libURL,n=!0;p="/"!==p.slice(-1)?p+"/":p;var z=function(){e.innerHTML=f; var a=e.getElementsByTagName("text"),b;[].forEach.call(a,function(a){["font-family","font-size"].forEach(function(b){for(var c=a;c&&c!==e;){if(c.style[b]){a.style[b]=c.style[b];break}c=c.parentNode}});a.style["font-family"]=a.style["font-family"]&&a.style["font-family"].split(" ").splice(-1);b=a.getElementsByTagName("title");[].forEach.call(b,function(b){a.removeChild(b)})});a=G(e.firstChild,0);try{m(a,l),c&&c()}catch(F){d(F)}};if("image/svg+xml"===h)try{if("undefined"!==typeof b.navigator.msSaveOrOpenBlob){var y= new MSBlobBuilder;y.append(f);var q=y.getBlob("image/svg+xml")}else q=B(f);m(q,l);c&&c()}catch(u){d(u)}else if("application/pdf"===h)b.jsPDF&&b.svg2pdf?z():(n=!0,k(p+"jspdf.js",function(){k(p+"svg2pdf.js",function(){z()})}));else{q=B(f);var w=function(){try{a.domurl.revokeObjectURL(q)}catch(u){}};v(q,h,{},r,function(a){try{m(a,l),c&&c()}catch(A){d(A)}},function(){var a=x.createElement("canvas"),e=a.getContext("2d"),g=f.match(/^<svg[^>]*width\s*=\s*"?(\d+)"?[^>]*>/)[1]*r,q=f.match(/^<svg[^>]*height\s*=\s*"?(\d+)"?[^>]*>/)[1]* r,t=function(){b.canvg.Canvg.fromString(e,f).start();try{m(b.navigator.msSaveOrOpenBlob?a.msToBlob():a.toDataURL(h),l),c&&c()}catch(K){d(K)}finally{w()}};a.width=g;a.height=q;b.canvg?t():(n=!0,k(p+"canvg.js",function(){t()}))},d,d,function(){n&&w()})}};a.getScript=k;a.imageToDataUrl=v;a.svgToDataUrl=B;a.svgToPdf=G})(v||(v={}));return v});k(a,"masters/modules/offline-exporting.src.js",[a["Core/Globals.js"],a["Extensions/OfflineExporting/OfflineExporting.js"]],function(a,k){a.downloadSVGLocal=k.downloadSVGLocal; k.compose(a.Chart)})}); //# sourceMappingURL=offline-exporting.js.map
const PNG = require('pngjs').PNG; const path = require('path'); const ejs = require('ejs'); const fs = require('fs'); const spriteOffset = 2; function Sprite(opt) { this.opt = opt !== undefined ? opt : {}; if (this.opt.globalTemplate === undefined) { this.opt.globalTemplate = '{' + 'background-image:url(<%- JSON.stringify(relativePngPath) %>);' + 'display:inline-block;' + 'background-repeat:no-repeat;' + 'overflow:hidden;' + 'background-size: <%= width / ratio %>px <%= height / ratio %>px;' + '}'; } if (this.opt.eachTemplate === undefined) { this.opt.eachTemplate = ('<%= "."+node.className %>{' + 'background-position:<%= -node.x / ratio %>px <%= -node.y / ratio %>px;' + 'width:<%= node.width / ratio %>px;' + 'height:<%= node.height / ratio %>px;' + 'text-indent:<%= node.width / ratio %>px;' + '}'); } if (this.opt.className === undefined) { this.opt.className = '<%= namespace != null ? namespace + "-" : "" %>' + '<%= path.normalize(node.image.base != null ? path.relative(node.image.base, node.image.path) : node.image.path).replace(/\\.png$/,"").replace(/\\W+/g,"-") %>'; } if (this.opt.cssTemplate === undefined) { this.opt.cssTemplate = '<%= nodes.map(function(node){ return "."+node.className }).join(", ") %>' + this.opt.globalTemplate + '<% nodes.forEach(function(node){ %>' + this.opt.eachTemplate + '<%})%>'; } if (this.opt.ratio === undefined) { this.opt.ratio = 1; } if (this.opt.namespace === undefined) { this.opt.namespace = null; } this.images = []; } Sprite.prototype.addImageSrc = function (images, cb) { var self = this, wait = images.length; images.forEach(function (imagePath) { fs.createReadStream(imagePath) .pipe(new PNG()) .on('parsed', function () { this.path = imagePath; self.images.push(this); if (--wait === 0 && cb !== undefined) { cb(); } }); }); }; Sprite.prototype.addFile = function (file, cb) { var self = this; file .pipe(new PNG()) .on('parsed', function () { this.path = file.path; this.base = file.base; self.images.push(this); if (cb !== undefined) { cb(); } }); }; Sprite.prototype.addFiles = function (files, cb) { var self = this, wait = files.length; files.forEach(function (file) { self.addFile(file, function () { if (--wait === 0 && cb !== undefined) { cb(); } }); }); }; Sprite.prototype.compile = function (relativePngPath) { var self = this, width = 0, height = 0, root = new Node(), sortedImage = this.images.sort(function (a, b) { var height = b.height - a.height; return height === 0 ? (b.path < a.path ? -1 : 1) : height; }); sortedImage.forEach(function (image) { root.insert(image); }); var nodes = root.getNodeWithImages(); nodes.forEach(function (node) { node.width -= spriteOffset; node.height -= spriteOffset; width = Math.max(width, node.width + node.x); height = Math.max(height, node.height + node.y); }); var png = new PNG({ width: width, height: height, deflateStrategy: 1 }); // clean png for (var i = 0; i < width * height * 4; i++) { png.data[i] = 0x00; } nodes.forEach((node) => { // Format Name node.className = ejs.render(this.opt.className, { path: path, node: node, namespace: this.opt.namespace }); node.image.bitblt(png, 0, 0, node.width, node.height, node.x, node.y); }); var cssString = ejs.render(this.opt.cssTemplate, { path: path, nodes: nodes, relativePngPath: relativePngPath.replace(/\\/g, '/'), ratio: this.opt.ratio, namespace: this.opt.namespace, width: width, height: height }); return { css: cssString, png: png.pack() }; }; exports.Sprite = Sprite; exports.gulp = function (opt) { return require('./gulp')(opt); }; function Node(x, y, width, height) { this.x = x || 0; this.y = y || 0; this.width = width || Infinity; this.height = height || Infinity; this.image = null; this.left = null; this.right = null; } Node.prototype.insert = function (image) { var width = image.width + spriteOffset var height = image.height + spriteOffset // if we're not a leaf if (this.image === null && this.left !== null && this.right !== null) { // try inserting into first child var newNode = this.left.insert(image); if (newNode !== null) { return newNode; } //no room, insert into second return this.right.insert(image); } // if there's already a image here if (this.image !== null){ return null; } // if we're too small if (this.width < width || this.height < height){ return null; } // if we're just right if (this.width === width && this.height === height) { this.image = image; return this; } // gotta split this node and create some kids var dw = this.width - width; var dh = this.height - height; if (dw > dh) { this.left = new Node( this.x, this.y, width, this.height ); this.right = new Node( this.x + width, this.y, this.width - width, this.height ); } else { this.left = new Node( this.x, this.y, this.width, height ); this.right = new Node( this.x, this.y + height, this.width, this.height - height ); } // insert into first child we created return this.left.insert(image); }; Node.prototype.getNodeWithImages = function () { if (this.image) { return [this]; } if (this.left !== null && this.right !== null) { return this.left.getNodeWithImages().concat(this.right.getNodeWithImages()); } return []; };
var app = angular.module("internal"); app.controller("MessengerController", function ($scope, $routeParams, $rootScope, msgService, socketService) { $scope.conversations = []; // stores the current conversation $scope.currentConversation = { 'id': null, 'participants': null, 'messages': null }; // stores participant representing the current user in the current conversation $scope.currentParticipant = -1; $scope.setConversation = function (conversationId) { $scope.getMessages(conversationId); $routeParams.conversationId = conversationId; }; $scope.getConversations = function () { msgService.getConversations().query(function (response) { $scope.conversations = response; $scope.conversations.sort(compareConversations); // select initial conversation // if no conversation is selected, // show the latest if ($routeParams.conversationId) $scope.getMessages(parseInt($routeParams.conversationId)); else if ($scope.conversations.length > 0) $scope.getMessages($scope.conversations[0].id); }); }; $scope.getMessages = function (conversationId) { msgService.getMessages(conversationId).get(function (response) { if (response.exists && response.member) { $scope.currentConversation.id = response.data.id; $scope.currentConversation.participants = response.data.participants; $scope.currentConversation.messages = response.data.messages; $scope.currentParticipant = $scope.currentConversation.participants[indexOfParticipant($scope.user.id)]; // remove this conversation from unreadconversations array $rootScope.notifications.messenger.conversations.splice($.inArray(conversationId, $rootScope.notifications.messenger.conversations), 1); // update last read attribute of participant msgService.updateLastRead($scope.currentParticipant.id, {last_read: moment().toISOString()}).save(); } }); }; $scope.submitMessage = function () { let input = $('#message_input_field').val().trim(); if (input !== '') { msgService.sendMessage({conversation_id: $scope.currentConversation.id, body: input}).save(function (response) { // console.log(response); }); } $('#message_input_field').val(''); $('#message_input_field').focus(); }; /** * Checks if the given conversation contains unread messages. * @param {Number} conversationId * @returns {Boolean} true if conversation contains an unread message */ $scope.hasUnreadMessage = function (conversationId) { return $.inArray(conversationId, $rootScope.notifications.messenger.conversations) > -1; }; $scope.$watch(function() { return socketService.getMessage(); }, function(message) { if(message !== null) { // if message belongs to current conversation -> add message if (Number(message.conversation_id) === Number($scope.currentConversation.id)) { $scope.currentConversation.messages.push(message); } if(message.conversation_id === $scope.currentConversation.id) { msgService.updateLastRead($scope.currentParticipant.id, {last_read: moment().toISOString()}); } // update last_message attribute of conversation the new message belongs to and resort conversations $scope.conversations[indexOfConversation(message.conversation_id)].last_message = message.created_at; $scope.conversations.sort(compareConversations); } }, true); // socketService.on('messenger-channel:' + $scope.user.id, function (data) { // if (Number(data.conversation_id) === Number($scope.currentConversation.id)) { // $scope.currentConversation.messages.push(data); // } // // if new message arrives, trigger notification (unless message is sent in current conversation) // if ($.inArray(data.conversation_id, $rootScope.notifications.messenger.conversations) === -1) { // if (data.conversation_id !== $scope.currentConversation.id) // // new message is sent -> update conversation notification // $rootScope.notifications.messenger.conversations.push(data.conversation_id); // else // // new message is sent in current conversation -> update last read attribute of current user // msgService.updateLastRead($scope.currentParticipant.id, {last_read: moment().toISOString()}); // } // // update last_message attribute of current conversation and resort conversations // $scope.conversations[indexOfConversation(data.conversation_id)].last_message = data.created_at; // $scope.conversations.sort(compareConversations); // }); // comparison function for conversations (sorts by last message) function compareConversations(a, b) { if (moment(a.last_message) > moment(b.last_message)) return -1; if (moment(a.last_message) < moment(b.last_message)) return 1; return 0; } /** * Search the index of the conversation in the * conversation array. * @param {Number} conversationId * @returns {Number} index of conversation, else -1 */ function indexOfConversation(conversationId) { for (let i = 0; i < $scope.conversations.length; i++) { if (Number(conversationId) === Number($scope.conversations[i].id)) return i; } return -1; } /** * Search the index of the current user in * the participant array of the current * conversation. * @param {Number} userId * @returns {Number} index of user, else -1 */ function indexOfParticipant(userId) { for (let i = 0; i < $scope.currentConversation.participants.length; i++) { if (Number(userId) === Number($scope.currentConversation.participants[i].user_id)) return i; } return -1; } /** * Repositions the text input for new messages, so that it appears * on the bottom of the page. */ function fitToWindow() { let sidebar_height = $('#messenger_sidebar').height(); let input_height = $('.message_input_wrapper').height(); let message_wrapper_height = sidebar_height - input_height; $('.message_wrapper').css('height', message_wrapper_height); } // listen for changes to the window size $(window).resize(function() { fitToWindow(); }); // position textarea at page bottom angular.element(document).ready(function () { fitToWindow(); }); // load user's conversations $scope.getConversations(); });
var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res) { res.render('index', { title: 'Andromeda JS' }); }); module.exports = router;
/* Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ (function(){function t(a){return CKEDITOR.env.ie?a.$.clientWidth:parseInt(a.getComputedStyle("width"),10)}function o(a,g){var b=a.getComputedStyle("border-"+g+"-width"),c={thin:"0px",medium:"1px",thick:"2px"};0>b.indexOf("px")&&(b=b in c&&"none"!=a.getComputedStyle("border-style")?c[b]:0);return parseInt(b,10)}function w(a){var g=[],b=-1,c="rtl"==a.getComputedStyle("direction"),k;k=a.$.rows;for(var h=0,f,d,e,i=0,p=k.length;i<p;i++)e=k[i],f=e.cells.length,f>h&&(h=f,d=e);k=d;h=new CKEDITOR.dom.element(a.$.tBodies[0]); f=h.getDocumentPosition();d=0;for(e=k.cells.length;d<e;d++){var i=new CKEDITOR.dom.element(k.cells[d]),p=k.cells[d+1]&&new CKEDITOR.dom.element(k.cells[d+1]),b=b+(i.$.colSpan||1),l,j,m=i.getDocumentPosition().x;c?j=m+o(i,"left"):l=m+i.$.offsetWidth-o(i,"right");p?(m=p.getDocumentPosition().x,c?l=m+p.$.offsetWidth-o(p,"right"):j=m+o(p,"left")):(m=a.getDocumentPosition().x,c?l=m:j=m+a.$.offsetWidth);i=Math.max(j-l,3);g.push({table:a,index:b,x:l,y:f.y,width:i,height:h.$.offsetHeight,rtl:c})}return g} function u(a){(a.data||a).preventDefault()}function A(a){function g(){i=0;e.setOpacity(0);l&&b();var v=f.table;setTimeout(function(){v.removeCustomData("_cke_table_pillars")},0);d.removeListener("dragstart",u)}function b(){for(var v=f.rtl,a=v?m.length:x.length,b=0;b<a;b++){var c=x[b],d=m[b],e=f.table;CKEDITOR.tools.setTimeout(function(a,b,c,d,f,k){a&&a.setStyle("width",j(Math.max(b+k,0)));c&&c.setStyle("width",j(Math.max(d-k,0)));f&&e.setStyle("width",j(f+k*(v?-1:1)))},0,this,[c,c&&t(c),d,d&&t(d), (!c||!d)&&t(e)+o(e,"left")+o(e,"right"),l])}}function c(a){u(a);for(var a=f.index,c=CKEDITOR.tools.buildTableMap(f.table),b=[],g=[],j=Number.MAX_VALUE,o=j,s=f.rtl,r=0,w=c.length;r<w;r++){var n=c[r],q=n[a+(s?1:0)],n=n[a+(s?0:1)],q=q&&new CKEDITOR.dom.element(q),n=n&&new CKEDITOR.dom.element(n);if(!q||!n||!q.equals(n))q&&(j=Math.min(j,t(q))),n&&(o=Math.min(o,t(n))),b.push(q),g.push(n)}x=b;m=g;y=f.x-j;z=f.x+o;e.setOpacity(0.5);p=parseInt(e.getStyle("left"),10);l=0;i=1;e.on("mousemove",h);d.on("dragstart", u);d.on("mouseup",k,this)}function k(a){a.removeListener();g()}function h(a){r(a.data.getPageOffset().x)}var f,d,e,i,p,l,x,m,y,z;d=a.document;e=CKEDITOR.dom.element.createFromHtml('<div data-cke-temp=1 contenteditable=false unselectable=on style="position:absolute;cursor:col-resize;filter:alpha(opacity=0);opacity:0;padding:0;background-color:#004;background-image:none;border:0px none;z-index:10"></div>',d);a.on("destroy",function(){e.remove()});s||d.getDocumentElement().append(e);this.attachTo=function(a){i|| (s&&(d.getBody().append(e),l=0),f=a,e.setStyles({width:j(a.width),height:j(a.height),left:j(a.x),top:j(a.y)}),s&&e.setOpacity(0.25),e.on("mousedown",c,this),d.getBody().setStyle("cursor","col-resize"),e.show())};var r=this.move=function(a){if(!f)return 0;if(!i&&(a<f.x||a>f.x+f.width))return f=null,i=l=0,d.removeListener("mouseup",k),e.removeListener("mousedown",c),e.removeListener("mousemove",h),d.getBody().setStyle("cursor","auto"),s?e.remove():e.hide(),0;a-=Math.round(e.$.offsetWidth/2);if(i){if(a== y||a==z)return 1;a=Math.max(a,y);a=Math.min(a,z);l=a-p}e.setStyle("left",j(a));return 1}}function r(a){var g=a.data.getTarget();if("mouseout"==a.name){if(!g.is("table"))return;for(var b=new CKEDITOR.dom.element(a.data.$.relatedTarget||a.data.$.toElement);b&&b.$&&!b.equals(g)&&!b.is("body");)b=b.getParent();if(!b||b.equals(g))return}g.getAscendant("table",1).removeCustomData("_cke_table_pillars");a.removeListener()}var j=CKEDITOR.tools.cssLength,s=CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks); CKEDITOR.plugins.add("tableresize",{requires:"tabletools",init:function(a){a.on("contentDom",function(){var g,b=a.editable();b.attachListener(b.isInline()?b:a.document,"mousemove",function(c){var c=c.data,b=c.getPageOffset().x;if(g&&g.move(b))u(c);else{var c=c.getTarget(),h;if(c.is("table")||c.getAscendant("tbody",1)){h=c.getAscendant("table",1);if(!(c=h.getCustomData("_cke_table_pillars")))h.setCustomData("_cke_table_pillars",c=w(h)),h.on("mouseout",r),h.on("mousedown",r);a:{h=0;for(var f=c.length;h< f;h++){var d=c[h];if(b>=d.x&&b<=d.x+d.width){b=d;break a}}b=null}b&&(!g&&(g=new A(a)),g.attachTo(b))}}})})}})})();
/*! * DevExtreme (dx.messages.zh.js) * Version: 20.2.3 (build 20305-1832) * Build date: Sat Oct 31 2020 * * Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; ! function(root, factory) { if ("function" === typeof define && define.amd) { define(function(require) { factory(require("devextreme/localization")) }) } else { if ("object" === typeof module && module.exports) { factory(require("devextreme/localization")) } else { factory(DevExpress.localization) } } }(this, function(localization) { localization.loadMessages({ zh: { Yes: "\u662f", No: "\u5426", Cancel: "\u53d6\u6d88", Clear: "\u6e05\u9664", Done: "\u5b8c\u6210", Loading: "\u6b63\u5728\u52a0\u8f7d...", Select: "\u9009\u62e9...", Search: "\u641c\u7d22", Back: "\u8fd4\u56de", OK: "\u786e\u5b9a", "dxCollectionWidget-noDataText": "\u6ca1\u6709\u8981\u663e\u793a\u7684\u6570\u636e", "dxDropDownEditor-selectLabel": "\u9009\u62e9", "validation-required": "\u5fc5\u9700", "validation-required-formatted": "{0} \u662f\u5fc5\u9700\u7684", "validation-numeric": "\u503c\u5fc5\u987b\u662f\u4e00\u4e2a\u6570\u5b57", "validation-numeric-formatted": "{0} \u5fc5\u987b\u662f\u4e00\u4e2a\u6570\u5b57", "validation-range": "\u503c\u8d85\u51fa\u8303\u56f4", "validation-range-formatted": "{0} \u8d85\u51fa\u8303\u56f4", "validation-stringLength": "\u8be5\u503c\u7684\u957f\u5ea6\u4e0d\u6b63\u786e", "validation-stringLength-formatted": "{0} \u7684\u957f\u5ea6\u4e0d\u6b63\u786e", "validation-custom": "\u503c\u65e0\u6548", "validation-custom-formatted": "{0} \u503c\u65e0\u6548", "validation-async": "\u503c\u65e0\u6548", "validation-async-formatted": "{0} \u503c\u65e0\u6548", "validation-compare": "\u503c\u4e0d\u5339\u914d", "validation-compare-formatted": "{0} \u4e0d\u5339\u914d", "validation-pattern": "\u503c\u4e0d\u7b26\u5408\u8be5\u6a21\u5f0f", "validation-pattern-formatted": "{0} \u4e0d\u5339\u914d\u8be5\u6a21\u5f0f", "validation-email": "\u7535\u5b50\u90ae\u4ef6\u65e0\u6548", "validation-email-formatted": "{0} \u65e0\u6548", "validation-mask": "\u503c\u65e0\u6548", "dxLookup-searchPlaceholder": "\u6700\u5c0f\u5b57\u7b26\u6570: {0}", "dxList-pullingDownText": "\u4e0b\u62c9\u4ee5\u5237\u65b0...", "dxList-pulledDownText": "\u653e\u5f00\u4ee5\u5237\u65b0...", "dxList-refreshingText": "\u5237\u65b0\u4e2d...", "dxList-pageLoadingText": "\u6b63\u5728\u52a0\u8f7d...", "dxList-nextButtonText": "\u66f4\u591a", "dxList-selectAll": "\u5168\u9009", "dxListEditDecorator-delete": "\u5220\u9664", "dxListEditDecorator-more": "\u66f4\u591a", "dxScrollView-pullingDownText": "\u4e0b\u62c9\u4ee5\u5237\u65b0...", "dxScrollView-pulledDownText": "\u653e\u5f00\u4ee5\u5237\u65b0...", "dxScrollView-refreshingText": "\u5237\u65b0\u4e2d...", "dxScrollView-reachBottomText": "\u6b63\u5728\u52a0\u8f7d...", "dxDateBox-simulatedDataPickerTitleTime": "\u9009\u62e9\u65f6\u95f4", "dxDateBox-simulatedDataPickerTitleDate": "\u9009\u62e9\u65e5\u671f", "dxDateBox-simulatedDataPickerTitleDateTime": "\u9009\u62e9\u65e5\u671f\u548c\u65f6\u95f4", "dxDateBox-validation-datetime": "\u503c\u5fc5\u987b\u662f\u65e5\u671f\u6216\u65f6\u95f4", "dxFileUploader-selectFile": "\u9009\u62e9\u6587\u4ef6", "dxFileUploader-dropFile": "\u6216\u8005\u628a\u6587\u4ef6\u653e\u5728\u6b64\u5904", "dxFileUploader-bytes": "bytes", "dxFileUploader-kb": "kb", "dxFileUploader-Mb": "Mb", "dxFileUploader-Gb": "Gb", "dxFileUploader-upload": "\u4e0a\u4f20", "dxFileUploader-uploaded": "\u5df2\u4e0a\u4f20", "dxFileUploader-readyToUpload": "\u51c6\u5907\u4e0a\u4f20", "dxFileUploader-uploadAbortedMessage": "TODO", "dxFileUploader-uploadFailedMessage": "\u4e0a\u4f20\u5931\u8d25", "dxFileUploader-invalidFileExtension": "\u6587\u4ef6\u7c7b\u578b\u9519\u8bef", "dxFileUploader-invalidMaxFileSize": "\u6587\u4ef6\u8fc7\u5927", "dxFileUploader-invalidMinFileSize": "\u6587\u4ef6\u8fc7\u5c0f", "dxRangeSlider-ariaFrom": "\u4ece", "dxRangeSlider-ariaTill": "\u81f3", "dxSwitch-switchedOnText": "\u5f00", "dxSwitch-switchedOffText": "\u5173", "dxForm-optionalMark": "\u53ef\u9009", "dxForm-requiredMessage": "{0} \u662f\u5fc5\u987b\u7684", "dxNumberBox-invalidValueMessage": "\u503c\u5fc5\u987b\u662f\u4e00\u4e2a\u6570\u5b57", "dxNumberBox-noDataText": "\u65e0\u6570\u636e", "dxDataGrid-columnChooserTitle": "\u5217\u9009\u62e9\u5668", "dxDataGrid-columnChooserEmptyText": "\u5728\u8fd9\u91cc\u62d6\u52a8\u4e00\u5217\u9690\u85cf\u5b83", "dxDataGrid-groupContinuesMessage": "\u4e0b\u4e00\u9875", "dxDataGrid-groupContinuedMessage": "\u4e0a\u4e00\u9875", "dxDataGrid-groupHeaderText": "\u901a\u8fc7\u8be5\u5217\u5206\u7ec4", "dxDataGrid-ungroupHeaderText": "\u53d6\u6d88\u5206\u7ec4", "dxDataGrid-ungroupAllText": "\u53d6\u6d88\u6240\u6709\u5206\u7ec4", "dxDataGrid-editingEditRow": "\u7f16\u8f91", "dxDataGrid-editingSaveRowChanges": "\u4fdd\u5b58", "dxDataGrid-editingCancelRowChanges": "\u53d6\u6d88", "dxDataGrid-editingDeleteRow": "\u5220\u9664", "dxDataGrid-editingUndeleteRow": "\u53d6\u6d88\u5220\u9664", "dxDataGrid-editingConfirmDeleteMessage": "\u4f60\u786e\u5b9a\u8981\u5220\u9664\u8fd9\u6761\u8bb0\u5f55\u5417\uff1f", "dxDataGrid-validationCancelChanges": "\u53d6\u6d88\u66f4\u6539", "dxDataGrid-groupPanelEmptyText": "\u62d6\u52a8\u5217\u6807\u9898\u81f3\u6b64\u4ee5\u8fdb\u884c\u5217\u5206\u7ec4", "dxDataGrid-noDataText": "\u65e0\u6570\u636e", "dxDataGrid-searchPanelPlaceholder": "\u641c\u7d22...", "dxDataGrid-filterRowShowAllText": "(\u5168\u90e8)", "dxDataGrid-filterRowResetOperationText": "\u91cd\u7f6e", "dxDataGrid-filterRowOperationEquals": "\u7b49\u4e8e", "dxDataGrid-filterRowOperationNotEquals": "\u4e0d\u7b49\u4e8e", "dxDataGrid-filterRowOperationLess": "\u5c0f\u4e8e", "dxDataGrid-filterRowOperationLessOrEquals": "\u5c0f\u4e8e\u6216\u7b49\u4e8e", "dxDataGrid-filterRowOperationGreater": "\u5927\u4e8e", "dxDataGrid-filterRowOperationGreaterOrEquals": "\u5927\u4e8e\u6216\u7b49\u4e8e", "dxDataGrid-filterRowOperationStartsWith": "\u4ee5...\u5f00\u59cb", "dxDataGrid-filterRowOperationContains": "\u5305\u542b", "dxDataGrid-filterRowOperationNotContains": "\u4e0d\u5305\u542b", "dxDataGrid-filterRowOperationEndsWith": "\u7ed3\u675f\u4e8e", "dxDataGrid-filterRowOperationBetween": "\u4e4b\u95f4", "dxDataGrid-filterRowOperationBetweenStartText": "\u5f00\u59cb", "dxDataGrid-filterRowOperationBetweenEndText": "\u7ed3\u675f", "dxDataGrid-applyFilterText": "\u5e94\u7528\u8fc7\u6ee4\u5668", "dxDataGrid-trueText": "\u771f", "dxDataGrid-falseText": "\u5047", "dxDataGrid-sortingAscendingText": "\u5347\u5e8f\u6392\u5e8f", "dxDataGrid-sortingDescendingText": "\u964d\u5e8f\u6392\u5e8f", "dxDataGrid-sortingClearText": "\u6e05\u9664\u6392\u5e8f", "dxDataGrid-editingSaveAllChanges": "\u4fdd\u5b58\u4fee\u6539", "dxDataGrid-editingCancelAllChanges": "\u653e\u5f03\u4fee\u6539", "dxDataGrid-editingAddRow": "\u6dfb\u52a0\u4e00\u884c", "dxDataGrid-summaryMin": "\u6700\u5c0f\u503c: {0}", "dxDataGrid-summaryMinOtherColumn": "{1} \u7684\u6700\u5c0f\u503c\u4e3a {0}", "dxDataGrid-summaryMax": "\u6700\u5927\u503c: {0}", "dxDataGrid-summaryMaxOtherColumn": "{1} \u7684\u6700\u5927\u503c\u4e3a {0}", "dxDataGrid-summaryAvg": "\u5e73\u5747\u503c: {0}", "dxDataGrid-summaryAvgOtherColumn": "{1} \u7684\u5e73\u5747\u503c\u4e3a {0}", "dxDataGrid-summarySum": "\u603b\u548c: {0}", "dxDataGrid-summarySumOtherColumn": "{1} \u7684\u603b\u548c\u4e3a {0}", "dxDataGrid-summaryCount": "\u8ba1\u6570: {0}", "dxDataGrid-columnFixingFix": "\u56fa\u5b9a", "dxDataGrid-columnFixingUnfix": "\u4e0d\u56fa\u5b9a", "dxDataGrid-columnFixingLeftPosition": "\u5411\u5de6", "dxDataGrid-columnFixingRightPosition": "\u5411\u53f3", "dxDataGrid-exportTo": "\u5bfc\u51fa", "dxDataGrid-exportToExcel": "\u5bfc\u51faExcel\u6587\u4ef6", "dxDataGrid-exporting": "\u5bfc\u51fa...", "dxDataGrid-excelFormat": "Excel\u6587\u4ef6", "dxDataGrid-selectedRows": "\u5df2\u9009\u884c", "dxDataGrid-exportSelectedRows": "\u5bfc\u51fa\u5df2\u9009\u884c", "dxDataGrid-exportAll": "\u5bfc\u51fa\u6240\u6709\u6570\u636e", "dxDataGrid-headerFilterEmptyValue": "(\u7a7a\u767d)", "dxDataGrid-headerFilterOK": "\u597d", "dxDataGrid-headerFilterCancel": "\u53d6\u6d88", "dxDataGrid-ariaColumn": "\u5217", "dxDataGrid-ariaValue": "\u503c", "dxDataGrid-ariaFilterCell": "\u8fc7\u6ee4\u5355\u5143", "dxDataGrid-ariaCollapse": "\u6298\u53e0", "dxDataGrid-ariaExpand": "\u5c55\u5f00", "dxDataGrid-ariaDataGrid": "\u6570\u636e\u7f51\u683c", "dxDataGrid-ariaSearchInGrid": "\u5728\u6570\u636e\u7f51\u683c\u4e2d\u641c\u7d22", "dxDataGrid-ariaSelectAll": "\u5168\u9009", "dxDataGrid-ariaSelectRow": "\u9009\u62e9\u884c", "dxDataGrid-filterBuilderPopupTitle": "\u8fc7\u6ee4\u5668\u751f\u6210\u5668", "dxDataGrid-filterPanelCreateFilter": "\u521b\u5efa\u8fc7\u6ee4\u5668", "dxDataGrid-filterPanelClearFilter": "\u6e05\u7a7a", "dxDataGrid-filterPanelFilterEnabledHint": "\u542f\u7528\u8be5\u8fc7\u6ee4\u5668", "dxTreeList-ariaTreeList": "\u6811\u72b6\u5217\u8868", "dxTreeList-editingAddRowToNode": "\u6dfb\u52a0", "dxPager-infoText": "\u7b2c{0}\u9875,\u5171{1}\u9875 ({2} \u4e2a\u9879\u76ee)", "dxPager-pagesCountText": "\u5230", "dxPager-pageSizesAllText": "\u5168\u90e8", "dxPivotGrid-grandTotal": "\u5408\u8ba1", "dxPivotGrid-total": "{0} \u603b\u8ba1", "dxPivotGrid-fieldChooserTitle": "\u5b57\u6bb5\u9009\u62e9\u5668", "dxPivotGrid-showFieldChooser": "\u663e\u793a\u5b57\u6bb5\u9009\u62e9\u5668", "dxPivotGrid-expandAll": "\u5168\u90e8\u5c55\u5f00", "dxPivotGrid-collapseAll": "\u5168\u90e8\u6298\u53e0", "dxPivotGrid-sortColumnBySummary": '\u6309 "{0}" \u5217\u6392\u5e8f', "dxPivotGrid-sortRowBySummary": '\u6309 "{0}" \u884c\u6392\u5e8f', "dxPivotGrid-removeAllSorting": "\u6e05\u9664\u6240\u6709\u6392\u5e8f", "dxPivotGrid-dataNotAvailable": "\u4e0d\u9002\u7528", "dxPivotGrid-rowFields": "\u884c\u5b57\u6bb5", "dxPivotGrid-columnFields": "\u5217\u5b57\u6bb5", "dxPivotGrid-dataFields": "\u6570\u636e\u5b57\u6bb5", "dxPivotGrid-filterFields": "\u8fc7\u6ee4\u5b57\u6bb5", "dxPivotGrid-allFields": "\u6240\u6709\u5b57\u6bb5", "dxPivotGrid-columnFieldArea": "\u5c06\u5217\u62d6\u52a8\u5230\u6b64\u5904", "dxPivotGrid-dataFieldArea": "\u5c06\u6570\u636e\u62d6\u52a8\u5230\u6b64\u5904", "dxPivotGrid-rowFieldArea": "\u5c06\u884c\u5b57\u6bb5\u62d6\u5230\u5230\u6b64\u6b21", "dxPivotGrid-filterFieldArea": "\u62d6\u52a8\u7b5b\u9009\u5b57\u6bb5\u5230\u6b64\u5904", "dxScheduler-editorLabelTitle": "\u6807\u9898", "dxScheduler-editorLabelStartDate": "\u5f00\u59cb\u65e5\u671f", "dxScheduler-editorLabelEndDate": "\u7ed3\u675f\u65e5\u671f", "dxScheduler-editorLabelDescription": "\u63cf\u8ff0", "dxScheduler-editorLabelRecurrence": "\u91cd\u590d", "dxScheduler-openAppointment": "\u6253\u5f00\u65e5\u7a0b", "dxScheduler-recurrenceNever": "\u6c38\u4e0d", "dxScheduler-recurrenceMinutely": "Minutely", "dxScheduler-recurrenceHourly": "Hourly", "dxScheduler-recurrenceDaily": "\u65e5\u5e38", "dxScheduler-recurrenceWeekly": "\u6bcf\u5468", "dxScheduler-recurrenceMonthly": "\u6bcf\u6708", "dxScheduler-recurrenceYearly": "\u6bcf\u5e74", "dxScheduler-recurrenceRepeatEvery": "\u6240\u6709", "dxScheduler-recurrenceRepeatOn": "Repeat On", "dxScheduler-recurrenceEnd": "\u505c\u6b62\u91cd\u590d", "dxScheduler-recurrenceAfter": "\u4e4b\u540e", "dxScheduler-recurrenceOn": "\u5728", "dxScheduler-recurrenceRepeatMinutely": "minute(s)", "dxScheduler-recurrenceRepeatHourly": "hour(s)", "dxScheduler-recurrenceRepeatDaily": "\u65e5", "dxScheduler-recurrenceRepeatWeekly": "\u5468", "dxScheduler-recurrenceRepeatMonthly": "\u6708", "dxScheduler-recurrenceRepeatYearly": "\u5e74", "dxScheduler-switcherDay": "\u65e5", "dxScheduler-switcherWeek": "\u5468", "dxScheduler-switcherWorkWeek": "\u5de5\u4f5c\u5468", "dxScheduler-switcherMonth": "\u6708", "dxScheduler-switcherAgenda": "\u8bae\u7a0b", "dxScheduler-switcherTimelineDay": "\u65f6\u95f4\u8f74\u65e5", "dxScheduler-switcherTimelineWeek": "\u65f6\u95f4\u8f74\u5468", "dxScheduler-switcherTimelineWorkWeek": "\u65f6\u95f4\u8f74\u5de5\u4f5c\u5468", "dxScheduler-switcherTimelineMonth": "\u65f6\u95f4\u8f74\u6708", "dxScheduler-recurrenceRepeatOnDate": "\u4e8e\u65e5\u671f", "dxScheduler-recurrenceRepeatCount": "\u4e8b\u4ef6", "dxScheduler-allDay": "\u5168\u5929", "dxScheduler-confirmRecurrenceEditMessage": "\u4f60\u60f3\u53ea\u4fee\u6539\u8be5\u65e5\u7a0b\u8fd8\u662f\u60f3\u4fee\u6539\u6574\u4e2a\u7cfb\u5217\u7684\u65e5\u7a0b?", "dxScheduler-confirmRecurrenceDeleteMessage": "\u4f60\u60f3\u53ea\u5220\u9664\u8fd9\u4e2a\u65e5\u7a0b\u8fd8\u662f\u60f3\u5220\u9664\u6574\u4e2a\u7cfb\u5217\u7684\u65e5\u7a0b?", "dxScheduler-confirmRecurrenceEditSeries": "\u4fee\u6539\u8be5\u7cfb\u5217\u7684\u65e5\u7a0b", "dxScheduler-confirmRecurrenceDeleteSeries": "\u5220\u9664\u8be5\u7cfb\u5217\u7684\u65e5\u7a0b", "dxScheduler-confirmRecurrenceEditOccurrence": "\u4fee\u6539\u65e5\u7a0b", "dxScheduler-confirmRecurrenceDeleteOccurrence": "\u5220\u9664\u65e5\u7a0b", "dxScheduler-noTimezoneTitle": "\u6ca1\u6709\u65f6\u533a", "dxScheduler-moreAppointments": "{0} \u66f4\u591a", "dxCalendar-todayButtonText": "\u4eca\u5929", "dxCalendar-ariaWidgetName": "\u65e5\u5386", "dxColorView-ariaRed": "\u7ea2\u8272", "dxColorView-ariaGreen": "\u7eff\u8272", "dxColorView-ariaBlue": "\u84dd\u8272", "dxColorView-ariaAlpha": "\u900f\u660e\u5ea6", "dxColorView-ariaHex": "\u8272\u6807", "dxTagBox-selected": "{0} \u5df2\u9009\u62e9", "dxTagBox-allSelected": "\u5df2\u5168\u9009 ({0})", "dxTagBox-moreSelected": "{0} \u66f4\u591a", "vizExport-printingButtonText": "\u6253\u5370", "vizExport-titleMenuText": "\u5bfc\u51fa\u4e2d/\u6253\u5370\u4e2d", "vizExport-exportButtonText": "{0} \u6587\u4ef6", "dxFilterBuilder-and": "\u4e0e", "dxFilterBuilder-or": "\u6216", "dxFilterBuilder-notAnd": "\u4e0e\u975e", "dxFilterBuilder-notOr": "\u6216\u975e", "dxFilterBuilder-addCondition": "\u6dfb\u52a0\u6761\u4ef6", "dxFilterBuilder-addGroup": "\u6dfb\u52a0\u7ec4", "dxFilterBuilder-enterValueText": "<\u8f93\u5165\u503c>", "dxFilterBuilder-filterOperationEquals": "\u7b49\u4e8e", "dxFilterBuilder-filterOperationNotEquals": "\u4e0d\u7b49\u4e8e", "dxFilterBuilder-filterOperationLess": "\u5c0f\u4e8e", "dxFilterBuilder-filterOperationLessOrEquals": "\u5c0f\u4e8e\u6216\u7b49\u4e8e", "dxFilterBuilder-filterOperationGreater": "\u5927\u4e8e", "dxFilterBuilder-filterOperationGreaterOrEquals": "\u5927\u4e8e\u6216\u7b49\u4e8e", "dxFilterBuilder-filterOperationStartsWith": "\u5f00\u59cb\u4e8e", "dxFilterBuilder-filterOperationContains": "\u5305\u542b", "dxFilterBuilder-filterOperationNotContains": "\u4e0d\u5305\u542b", "dxFilterBuilder-filterOperationEndsWith": "\u7ed3\u675f\u4e8e", "dxFilterBuilder-filterOperationIsBlank": "\u7a7a", "dxFilterBuilder-filterOperationIsNotBlank": "\u4e0d\u4e3a\u7a7a", "dxFilterBuilder-filterOperationBetween": "\u4e4b\u95f4", "dxFilterBuilder-filterOperationAnyOf": "\u4efb\u4f55\u4e00\u4e2a", "dxFilterBuilder-filterOperationNoneOf": "\u4efb\u4f55\u4e00\u4e2a\u90fd\u4e0d", "dxHtmlEditor-dialogColorCaption": "\u66f4\u6539\u5b57\u4f53\u989c\u8272", "dxHtmlEditor-dialogBackgroundCaption": "\u66f4\u6539\u80cc\u666f\u989c\u8272", "dxHtmlEditor-dialogLinkCaption": "\u6dfb\u52a0\u94fe\u63a5", "dxHtmlEditor-dialogLinkUrlField": "\u94fe\u63a5\u5730\u5740", "dxHtmlEditor-dialogLinkTextField": "\u94fe\u63a5\u6587\u5b57", "dxHtmlEditor-dialogLinkTargetField": "\u5728\u65b0\u7a97\u53e3\u4e2d\u6253\u5f00", "dxHtmlEditor-dialogImageCaption": "\u6dfb\u52a0\u56fe\u7247", "dxHtmlEditor-dialogImageUrlField": "\u56fe\u7247\u5730\u5740", "dxHtmlEditor-dialogImageAltField": "\u66ff\u4ee3\u6587\u5b57", "dxHtmlEditor-dialogImageWidthField": "\u5bbd (px)", "dxHtmlEditor-dialogImageHeightField": "\u957f (px)", "dxHtmlEditor-dialogInsertTableRowsField": "!TODO", "dxHtmlEditor-dialogInsertTableColumnsField": "!TODO", "dxHtmlEditor-dialogInsertTableCaption": "!TODO", "dxHtmlEditor-heading": "\u6807\u9898", "dxHtmlEditor-normalText": "\u6b63\u6587", "dxFileManager-newDirectoryName": "TODO", "dxFileManager-rootDirectoryName": "TODO", "dxFileManager-errorNoAccess": "TODO", "dxFileManager-errorDirectoryExistsFormat": "TODO", "dxFileManager-errorFileExistsFormat": "TODO", "dxFileManager-errorFileNotFoundFormat": "TODO", "dxFileManager-errorDirectoryNotFoundFormat": "TODO", "dxFileManager-errorWrongFileExtension": "TODO", "dxFileManager-errorMaxFileSizeExceeded": "TODO", "dxFileManager-errorInvalidSymbols": "TODO", "dxFileManager-errorDefault": "TODO", "dxFileManager-errorDirectoryOpenFailed": "TODO", "dxDiagram-categoryGeneral": "TODO", "dxDiagram-categoryFlowchart": "TODO", "dxDiagram-categoryOrgChart": "TODO", "dxDiagram-categoryContainers": "TODO", "dxDiagram-categoryCustom": "TODO", "dxDiagram-commandExportToSvg": "TODO", "dxDiagram-commandExportToPng": "TODO", "dxDiagram-commandExportToJpg": "TODO", "dxDiagram-commandUndo": "TODO", "dxDiagram-commandRedo": "TODO", "dxDiagram-commandFontName": "TODO", "dxDiagram-commandFontSize": "TODO", "dxDiagram-commandBold": "TODO", "dxDiagram-commandItalic": "TODO", "dxDiagram-commandUnderline": "TODO", "dxDiagram-commandTextColor": "TODO", "dxDiagram-commandLineColor": "TODO", "dxDiagram-commandLineWidth": "TODO", "dxDiagram-commandLineStyle": "TODO", "dxDiagram-commandLineStyleSolid": "TODO", "dxDiagram-commandLineStyleDotted": "TODO", "dxDiagram-commandLineStyleDashed": "TODO", "dxDiagram-commandFillColor": "TODO", "dxDiagram-commandAlignLeft": "TODO", "dxDiagram-commandAlignCenter": "TODO", "dxDiagram-commandAlignRight": "TODO", "dxDiagram-commandConnectorLineType": "TODO", "dxDiagram-commandConnectorLineStraight": "TODO", "dxDiagram-commandConnectorLineOrthogonal": "TODO", "dxDiagram-commandConnectorLineStart": "TODO", "dxDiagram-commandConnectorLineEnd": "TODO", "dxDiagram-commandConnectorLineNone": "TODO", "dxDiagram-commandConnectorLineArrow": "TODO", "dxDiagram-commandFullscreen": "TODO", "dxDiagram-commandUnits": "TODO", "dxDiagram-commandPageSize": "TODO", "dxDiagram-commandPageOrientation": "TODO", "dxDiagram-commandPageOrientationLandscape": "TODO", "dxDiagram-commandPageOrientationPortrait": "TODO", "dxDiagram-commandPageColor": "TODO", "dxDiagram-commandShowGrid": "TODO", "dxDiagram-commandSnapToGrid": "TODO", "dxDiagram-commandGridSize": "TODO", "dxDiagram-commandZoomLevel": "TODO", "dxDiagram-commandAutoZoom": "TODO", "dxDiagram-commandFitToContent": "TODO", "dxDiagram-commandFitToWidth": "TODO", "dxDiagram-commandAutoZoomByContent": "TODO", "dxDiagram-commandAutoZoomByWidth": "TODO", "dxDiagram-commandSimpleView": "TODO", "dxDiagram-commandCut": "TODO", "dxDiagram-commandCopy": "TODO", "dxDiagram-commandPaste": "TODO", "dxDiagram-commandSelectAll": "TODO", "dxDiagram-commandDelete": "TODO", "dxDiagram-commandBringToFront": "TODO", "dxDiagram-commandSendToBack": "TODO", "dxDiagram-commandLock": "TODO", "dxDiagram-commandUnlock": "TODO", "dxDiagram-commandInsertShapeImage": "TODO", "dxDiagram-commandEditShapeImage": "TODO", "dxDiagram-commandDeleteShapeImage": "TODO", "dxDiagram-commandLayoutLeftToRight": "TODO", "dxDiagram-commandLayoutRightToLeft": "TODO", "dxDiagram-commandLayoutTopToBottom": "TODO", "dxDiagram-commandLayoutBottomToTop": "TODO", "dxDiagram-unitIn": "TODO", "dxDiagram-unitCm": "TODO", "dxDiagram-unitPx": "TODO", "dxDiagram-dialogButtonOK": "TODO", "dxDiagram-dialogButtonCancel": "TODO", "dxDiagram-dialogInsertShapeImageTitle": "TODO", "dxDiagram-dialogEditShapeImageTitle": "TODO", "dxDiagram-dialogEditShapeImageSelectButton": "TODO", "dxDiagram-dialogEditShapeImageLabelText": "TODO", "dxDiagram-uiExport": "TODO", "dxDiagram-uiProperties": "TODO", "dxDiagram-uiSettings": "TODO", "dxDiagram-uiShowToolbox": "TODO", "dxDiagram-uiSearch": "TODO", "dxDiagram-uiStyle": "TODO", "dxDiagram-uiLayout": "TODO", "dxDiagram-uiLayoutTree": "TODO", "dxDiagram-uiLayoutLayered": "TODO", "dxDiagram-uiDiagram": "TODO", "dxDiagram-uiText": "TODO", "dxDiagram-uiObject": "TODO", "dxDiagram-uiConnector": "TODO", "dxDiagram-uiPage": "TODO", "dxDiagram-shapeText": "TODO", "dxDiagram-shapeRectangle": "TODO", "dxDiagram-shapeEllipse": "TODO", "dxDiagram-shapeCross": "TODO", "dxDiagram-shapeTriangle": "TODO", "dxDiagram-shapeDiamond": "TODO", "dxDiagram-shapeHeart": "TODO", "dxDiagram-shapePentagon": "TODO", "dxDiagram-shapeHexagon": "TODO", "dxDiagram-shapeOctagon": "TODO", "dxDiagram-shapeStar": "TODO", "dxDiagram-shapeArrowLeft": "TODO", "dxDiagram-shapeArrowUp": "TODO", "dxDiagram-shapeArrowRight": "TODO", "dxDiagram-shapeArrowDown": "TODO", "dxDiagram-shapeArrowUpDown": "TODO", "dxDiagram-shapeArrowLeftRight": "TODO", "dxDiagram-shapeProcess": "TODO", "dxDiagram-shapeDecision": "TODO", "dxDiagram-shapeTerminator": "TODO", "dxDiagram-shapePredefinedProcess": "TODO", "dxDiagram-shapeDocument": "TODO", "dxDiagram-shapeMultipleDocuments": "TODO", "dxDiagram-shapeManualInput": "TODO", "dxDiagram-shapePreparation": "TODO", "dxDiagram-shapeData": "TODO", "dxDiagram-shapeDatabase": "TODO", "dxDiagram-shapeHardDisk": "TODO", "dxDiagram-shapeInternalStorage": "TODO", "dxDiagram-shapePaperTape": "TODO", "dxDiagram-shapeManualOperation": "TODO", "dxDiagram-shapeDelay": "TODO", "dxDiagram-shapeStoredData": "TODO", "dxDiagram-shapeDisplay": "TODO", "dxDiagram-shapeMerge": "TODO", "dxDiagram-shapeConnector": "TODO", "dxDiagram-shapeOr": "TODO", "dxDiagram-shapeSummingJunction": "TODO", "dxDiagram-shapeContainerDefaultText": "TODO", "dxDiagram-shapeVerticalContainer": "TODO", "dxDiagram-shapeHorizontalContainer": "TODO", "dxDiagram-shapeCardDefaultText": "TODO", "dxDiagram-shapeCardWithImageOnLeft": "TODO", "dxDiagram-shapeCardWithImageOnTop": "TODO", "dxDiagram-shapeCardWithImageOnRight": "TODO", "dxGantt-dialogTitle": "TODO", "dxGantt-dialogStartTitle": "TODO", "dxGantt-dialogEndTitle": "TODO", "dxGantt-dialogProgressTitle": "TODO", "dxGantt-dialogResourcesTitle": "TODO", "dxGantt-dialogResourceManagerTitle": "TODO", "dxGantt-dialogTaskDetailsTitle": "TODO", "dxGantt-dialogEditResourceListHint": "TODO", "dxGantt-dialogEditNoResources": "TODO", "dxGantt-dialogButtonAdd": "TODO", "dxGantt-contextMenuNewTask": "TODO", "dxGantt-contextMenuNewSubtask": "TODO", "dxGantt-contextMenuDeleteTask": "TODO", "dxGantt-contextMenuDeleteDependency": "TODO", "dxGantt-dialogTaskDeleteConfirmation": "TODO", "dxGantt-dialogDependencyDeleteConfirmation": "TODO", "dxGantt-dialogResourcesDeleteConfirmation": "TODO", "dxGantt-dialogConstraintCriticalViolationMessage": "TODO", "dxGantt-dialogConstraintViolationMessage": "TODO", "dxGantt-dialogCancelOperationMessage": "TODO", "dxGantt-dialogDeleteDependencyMessage": "TODO", "dxGantt-dialogMoveTaskAndKeepDependencyMessage": "TODO", "dxGantt-undo": "TODO", "dxGantt-redo": "TODO", "dxGantt-expandAll": "TODO", "dxGantt-collapseAll": "TODO", "dxGantt-addNewTask": "TODO", "dxGantt-deleteSelectedTask": "TODO", "dxGantt-zoomIn": "TODO", "dxGantt-zoomOut": "TODO", "dxGantt-fullScreen": "TODO" } }) });
import React from 'react' import { render } from 'react-dom' import { Provider } from 'react-redux' import { basename } from 'config' import configureStore from 'store/configure' import api from 'services/api' import App from 'components/App' const initialState = window.__INITIAL_STATE__ const store = configureStore(initialState, { api: api.create() }) const renderApp = () => ( <Provider store={store}> <App /> </Provider> ) const root = document.getElementById('app') render(renderApp(), root) if (module.hot) { module.hot.accept('components/App', () => { require('components/App') render(renderApp(), root) }) }
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import 'isomorphic-fetch'; import React from 'react'; import ReactDOM from 'react-dom'; import FastClick from 'fastclick'; import queryString from 'query-string'; import { ApolloClient, ApolloProvider, createNetworkInterface, } from 'react-apollo'; import getMuiTheme from 'material-ui/styles/getMuiTheme'; import { createPath } from 'history/PathUtils'; import history from './core/history'; import App from './components/App'; import { updateMeta } from './core/DOMUtils'; import { ErrorReporter, deepForceUpdate } from './core/devUtils'; // react-tap-event-plugin provides onTouchTap() to all React Components. // It's a mobile-friendly onClick() alternative for components in Material-UI, // especially useful for the buttons. /* eslint-disable global-require */ const client = new ApolloClient({ ssrMode: true, // serverside rendering networkInterface: createNetworkInterface({ uri: 'http://localhost:3001/graphql', }), }); const muiTheme1 = getMuiTheme({ userAgent: navigator.userAgent, }); // Global (context) variables that can be easily accessed from any React component // https://facebook.github.io/react/docs/context.html const context = { // Enables critical path CSS rendering // https://github.com/kriasoft/isomorphic-style-loader insertCss: (...styles) => { // eslint-disable-next-line no-underscore-dangle const removeCss = styles.map(x => x._insertCss()); return () => { removeCss.forEach(f => f()); }; }, // Send Material-UI theme through context muiTheme: muiTheme1, }; // Switch off the native scroll restoration behavior and handle it manually // https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration const scrollPositionsHistory = {}; if (window.history && 'scrollRestoration' in window.history) { window.history.scrollRestoration = 'manual'; } let onRenderComplete = function initialRenderComplete() { const elem = document.getElementById('css'); if (elem) elem.parentNode.removeChild(elem); onRenderComplete = function renderComplete(route, location) { document.title = route.title; updateMeta('description', route.description); // Update necessary tags in <head> at runtime here, ie: // updateMeta('keywords', route.keywords); // updateCustomMeta('og:url', route.canonicalUrl); // updateCustomMeta('og:image', route.imageUrl); // updateLink('canonical', route.canonicalUrl); // etc. let scrollX = 0; let scrollY = 0; const pos = scrollPositionsHistory[location.key]; if (pos) { scrollX = pos.scrollX; scrollY = pos.scrollY; } else { const targetHash = location.hash.substr(1); if (targetHash) { const target = document.getElementById(targetHash); if (target) { scrollY = window.pageYOffset + target.getBoundingClientRect().top; } } } // Restore the scroll position if it was saved into the state // or scroll to the given #hash anchor // or scroll to top of the page window.scrollTo(scrollX, scrollY); // Google Analytics tracking. Don't send 'pageview' event after // the initial rendering, as it was already sent if (window.ga) { window.ga('send', 'pageview', createPath(location)); } }; }; // Make taps on links and buttons work fast on mobiles FastClick.attach(document.body); const container = document.getElementById('app'); let appInstance; let currentLocation = history.location; let router = require('./core/router').default; // Re-render the app when window.location changes async function onLocationChange(location, action) { // Remember the latest scroll position for the previous location scrollPositionsHistory[currentLocation.key] = { scrollX: window.pageXOffset, scrollY: window.pageYOffset, }; // Delete stored scroll position for next page if any if (action === 'PUSH') { delete scrollPositionsHistory[location.key]; } currentLocation = location; try { // Traverses the list of routes in the order they are defined until // it finds the first route that matches provided URL path string // and whose action method returns anything other than `undefined`. const route = await router.resolve({ path: location.pathname, query: queryString.parse(location.search), }); // Prevent multiple page renders during the routing process if (currentLocation.key !== location.key) { return; } if (route.redirect) { history.replace(route.redirect); return; } appInstance = ReactDOM.render( <App context={context}> <ApolloProvider client={client}> {route.component} </ApolloProvider> </App>, container, () => onRenderComplete(route, location), ); } catch (error) { // Display the error in full-screen for development mode if (__DEV__) { appInstance = null; document.title = `Error: ${error.message}`; ReactDOM.render(<ErrorReporter error={error} />, container); throw error; } console.error(error); // eslint-disable-line no-console // Do a full page reload if error occurs during client-side navigation if (action && currentLocation.key === location.key) { window.location.reload(); } } } // Handle client-side navigation by using HTML5 History API // For more information visit https://github.com/mjackson/history#readme history.listen(onLocationChange); onLocationChange(currentLocation); // Handle errors that might happen after rendering // Display the error in full-screen for development mode if (__DEV__) { window.addEventListener('error', (event) => { appInstance = null; document.title = `Runtime Error: ${event.error.message}`; ReactDOM.render(<ErrorReporter error={event.error} />, container); }); } // Enable Hot Module Replacement (HMR) if (module.hot) { module.hot.accept('./core/router', () => { router = require('./core/router').default; if (appInstance) { try { // Force-update the whole tree, including components that refuse to update deepForceUpdate(appInstance); } catch (error) { appInstance = null; document.title = `Hot Update Error: ${error.message}`; ReactDOM.render(<ErrorReporter error={error} />, container); return; } } onLocationChange(currentLocation); }); }
// https://leetcode.com/problems/remove-duplicates-from-sorted-array/#/description /** * @param {number[]} nums * @return {number} */ var removeDuplicates = function (nums) { if (nums.length < 2) return nums.length; var pos = 1; var i = 1; while (i < nums.length && pos < nums.length) { if (nums[i] !== nums[i - 1]) { nums[pos] = nums[i]; pos++; } i++; } nums.splice(pos, nums.length - pos); return nums.length; }; var nums = [1, 1, 2]; console.log(removeDuplicates(nums), nums); nums = [1, 1, 1, 1, 1]; console.log(removeDuplicates(nums), nums); nums = []; console.log(removeDuplicates(nums), nums); nums = [1, 2, 2]; console.log(removeDuplicates(nums), nums);
angular.module("socially").controller("LoginCtrl", ['$meteor', '$state', function ($meteor, $state) { var vm = this; vm.credentials = { email: '', password: '' }; vm.error = ''; vm.login = function () { $meteor.loginWithPassword(vm.credentials.email, vm.credentials.password).then( function () { $state.go('routes'); }, function (err) { vm.error = 'Login error - ' + err; } ); }; } ]);
import './polyfill'; import Delta from 'quill-delta'; import Editor from './editor'; import Emitter from './emitter'; import Module from './module'; import Parchment from 'parchment'; import Selection, { Range } from './selection'; import extend from 'extend'; import logger from './logger'; import Theme from './theme'; let debug = logger('quill'); class Quill { static debug(limit) { if (limit === true) { limit = 'log'; } logger.level(limit); } static find(node) { return node.__quill || Parchment.find(node); } static import(name) { if (this.imports[name] == null) { debug.error(`Cannot import ${name}. Are you sure it was registered?`); } return this.imports[name]; } static register(path, target, overwrite = false) { if (typeof path !== 'string') { let name = path.attrName || path.blotName; if (typeof name === 'string') { // register(Blot | Attributor, overwrite) this.register('formats/' + name, path, target); } else { Object.keys(path).forEach((key) => { this.register(key, path[key], target); }); } } else { if (this.imports[path] != null && !overwrite) { debug.warn(`Overwriting ${path} with`, target); } this.imports[path] = target; if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { Parchment.register(target); } } } constructor(container, options = {}) { this.options = expandConfig(container, options); this.container = this.options.container; this.scrollingContainer = this.options.scrollingContainer || document.body; if (this.container == null) { return debug.error('Invalid Quill container', container); } if (this.options.debug) { Quill.debug(this.options.debug); } let html = this.container.innerHTML.trim(); this.container.classList.add('ql-container'); this.container.innerHTML = ''; this.container.__quill = this; this.root = this.addContainer('ql-editor'); this.root.classList.add('ql-blank'); this.emitter = new Emitter(); this.scroll = Parchment.create(this.root, { emitter: this.emitter, whitelist: this.options.formats }); this.editor = new Editor(this.scroll); this.selection = new Selection(this.scroll, this.emitter); this.theme = new this.options.theme(this, this.options); this.keyboard = this.theme.addModule('keyboard'); this.clipboard = this.theme.addModule('clipboard'); this.history = this.theme.addModule('history'); this.theme.init(); this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => { if (type === Emitter.events.TEXT_CHANGE) { this.root.classList.toggle('ql-blank', this.editor.isBlank()); } }); this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => { let range = this.selection.lastRange; let index = range && range.length === 0 ? range.index : undefined; modify.call(this, () => { return this.editor.update(null, mutations, index); }, source); }); let contents = this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">${html}<p><br></p></div>`); this.setContents(contents); this.history.clear(); if (this.options.placeholder) { this.root.setAttribute('data-placeholder', this.options.placeholder); } if (this.options.readOnly) { this.disable(); } } addContainer(container, refNode = null) { if (typeof container === 'string') { let className = container; container = document.createElement('div'); container.classList.add(className); } this.container.insertBefore(container, refNode); return container; } blur() { this.selection.setRange(null); } deleteText(index, length, source) { [index, length, , source] = overload(index, length, source); return modify.call(this, () => { return this.editor.deleteText(index, length); }, source, index, -1*length); } disable() { this.enable(false); } enable(enabled = true) { this.scroll.enable(enabled); this.container.classList.toggle('ql-disabled', !enabled); if (!enabled) { this.blur(); } } focus() { let scrollTop = this.scrollingContainer.scrollTop; this.selection.focus(); this.scrollingContainer.scrollTop = scrollTop; this.selection.scrollIntoView(); } format(name, value, source = Emitter.sources.API) { return modify.call(this, () => { let range = this.getSelection(true); let change = new Delta(); if (range == null) { return change; } else if (Parchment.query(name, Parchment.Scope.BLOCK)) { change = this.editor.formatLine(range.index, range.length, { [name]: value }); } else if (range.length === 0) { this.selection.format(name, value); return change; } else { change = this.editor.formatText(range.index, range.length, { [name]: value }); } this.setSelection(range, Emitter.sources.SILENT); return change; }, source); } formatLine(index, length, name, value, source) { let formats; [index, length, formats, source] = overload(index, length, name, value, source); return modify.call(this, () => { return this.editor.formatLine(index, length, formats); }, source, index, 0); } formatText(index, length, name, value, source) { let formats; [index, length, formats, source] = overload(index, length, name, value, source); return modify.call(this, () => { return this.editor.formatText(index, length, formats); }, source, index, 0); } getBounds(index, length = 0) { if (typeof index === 'number') { return this.selection.getBounds(index, length); } else { return this.selection.getBounds(index.index, index.length); } } getContents(index = 0, length = this.getLength() - index) { [index, length] = overload(index, length); return this.editor.getContents(index, length); } getFormat(index = this.getSelection(), length = 0) { if (typeof index === 'number') { return this.editor.getFormat(index, length); } else { return this.editor.getFormat(index.index, index.length); } } getIndex(blot) { return blot.offset(this.scroll); } getLength() { return this.scroll.length(); } getLeaf(index) { return this.scroll.leaf(index); } getLine(index) { return this.scroll.line(index); } getLines(index = 0, length = Number.MAX_VALUE) { if (typeof index !== 'number') { return this.scroll.lines(index.index, index.length); } else { return this.scroll.lines(index, length); } } getModule(name) { return this.theme.modules[name]; } getSelection(focus = false) { if (focus) this.focus(); this.update(); // Make sure we access getRange with editor in consistent state return this.selection.getRange()[0]; } getText(index = 0, length = this.getLength() - index) { [index, length] = overload(index, length); return this.editor.getText(index, length); } hasFocus() { return this.selection.hasFocus(); } insertEmbed(index, embed, value, source = Quill.sources.API) { return modify.call(this, () => { return this.editor.insertEmbed(index, embed, value); }, source, index); } insertText(index, text, name, value, source) { let formats; [index, , formats, source] = overload(index, 0, name, value, source); return modify.call(this, () => { return this.editor.insertText(index, text, formats); }, source, index, text.length); } isEnabled() { return !this.container.classList.contains('ql-disabled'); } off() { return this.emitter.off.apply(this.emitter, arguments); } on() { return this.emitter.on.apply(this.emitter, arguments); } once() { return this.emitter.once.apply(this.emitter, arguments); } pasteHTML(index, html, source) { this.clipboard.dangerouslyPasteHTML(index, html, source); } removeFormat(index, length, source) { [index, length, , source] = overload(index, length, source); return modify.call(this, () => { return this.editor.removeFormat(index, length); }, source, index); } setContents(delta, source = Emitter.sources.API) { return modify.call(this, () => { delta = new Delta(delta); let length = this.getLength(); let deleted = this.editor.deleteText(0, length); let applied = this.editor.applyDelta(delta); let lastOp = applied.ops[applied.ops.length - 1]; if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\n') { this.editor.deleteText(this.getLength() - 1, 1); applied.delete(1); } let ret = deleted.compose(applied); return ret; }, source); } setSelection(index, length, source) { if (index == null) { this.selection.setRange(null, length || Quill.sources.API); } else { [index, length, , source] = overload(index, length, source); this.selection.setRange(new Range(index, length), source); } if (source !== Emitter.sources.SILENT) { this.selection.scrollIntoView(); } } setText(text, source = Emitter.sources.API) { let delta = new Delta().insert(text); return this.setContents(delta, source); } update(source = Emitter.sources.USER) { let change = this.scroll.update(source); // Will update selection before selection.update() does if text changes this.selection.update(source); return change; } updateContents(delta, source = Emitter.sources.API) { return modify.call(this, () => { delta = new Delta(delta); return this.editor.applyDelta(delta, source); }, source, true); } } Quill.DEFAULTS = { bounds: null, formats: null, modules: {}, placeholder: '', readOnly: false, scrollingContainer: null, strict: true, theme: 'default' }; Quill.events = Emitter.events; Quill.sources = Emitter.sources; // eslint-disable-next-line no-undef Quill.version = typeof(QUILL_VERSION) === 'undefined' ? 'dev' : QUILL_VERSION; Quill.imports = { 'delta' : Delta, 'parchment' : Parchment, 'core/module' : Module, 'core/theme' : Theme }; function expandConfig(container, userConfig) { userConfig = extend(true, { container: container, modules: { clipboard: true, keyboard: true, history: true } }, userConfig); if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { userConfig.theme = Theme; } else { userConfig.theme = Quill.import(`themes/${userConfig.theme}`); if (userConfig.theme == null) { throw new Error(`Invalid theme ${userConfig.theme}. Did you register it?`); } } let themeConfig = extend(true, {}, userConfig.theme.DEFAULTS); [themeConfig, userConfig].forEach(function(config) { config.modules = config.modules || {}; Object.keys(config.modules).forEach(function(module) { if (config.modules[module] === true) { config.modules[module] = {}; } }); }); let moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); let moduleConfig = moduleNames.reduce(function(config, name) { let moduleClass = Quill.import(`modules/${name}`); if (moduleClass == null) { debug.error(`Cannot load ${name} module. Are you sure you registered it?`); } else { config[name] = moduleClass.DEFAULTS || {}; } return config; }, {}); // Special case toolbar shorthand if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { userConfig.modules.toolbar = { container: userConfig.modules.toolbar }; } userConfig = extend(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); ['bounds', 'container', 'scrollingContainer'].forEach(function(key) { if (typeof userConfig[key] === 'string') { userConfig[key] = document.querySelector(userConfig[key]); } }); userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) { if (userConfig.modules[name]) { config[name] = userConfig.modules[name]; } return config; }, {}); return userConfig; } // Handle selection preservation and TEXT_CHANGE emission // common to modification APIs function modify(modifier, source, index, shift) { if (this.options.strict && !this.isEnabled() && source === Emitter.sources.USER) { return new Delta(); } let range = index == null ? null : this.getSelection(); let oldDelta = this.editor.delta; let change = modifier(); if (range != null) { if (index === true) index = range.index; if (shift == null) { range = shiftRange(range, change, source); } else if (shift !== 0) { range = shiftRange(range, index, shift, source); } this.setSelection(range, Emitter.sources.SILENT); } if (change.length() > 0) { let args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source]; this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args); if (source !== Emitter.sources.SILENT) { this.emitter.emit(...args); } } return change; } function overload(index, length, name, value, source) { let formats = {}; if (typeof index.index === 'number' && typeof index.length === 'number') { // Allow for throwaway end (used by insertText/insertEmbed) if (typeof length !== 'number') { source = value, value = name, name = length, length = index.length, index = index.index; } else { length = index.length, index = index.index; } } else if (typeof length !== 'number') { source = value, value = name, name = length, length = 0; } // Handle format being object, two format name/value strings or excluded if (typeof name === 'object') { formats = name; source = value; } else if (typeof name === 'string') { if (value != null) { formats[name] = value; } else { source = name; } } // Handle optional source source = source || Emitter.sources.API; return [index, length, formats, source]; } function shiftRange(range, index, length, source) { if (range == null) return null; let start, end; if (index instanceof Delta) { [start, end] = [range.index, range.index + range.length].map(function(pos) { return index.transformPosition(pos, source === Emitter.sources.USER); }); } else { [start, end] = [range.index, range.index + range.length].map(function(pos) { if (pos < index || (pos === index && source !== Emitter.sources.USER)) return pos; if (length >= 0) { return pos + length; } else { return Math.max(index, pos + length); } }); } return new Range(start, end - start); } export { expandConfig, overload, Quill as default };
/** * vee-validate v4.5.6 * (c) 2021 Abdelrahman Awad * @license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) : typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VeeValidate = {}, global.Vue)); })(this, (function (exports, vue) { 'use strict'; function isCallable(fn) { return typeof fn === 'function'; } function isNullOrUndefined(value) { return value === null || value === undefined; } const isObject = (obj) => obj !== null && !!obj && typeof obj === 'object' && !Array.isArray(obj); function isIndex(value) { return Number(value) >= 0; } function toNumber(value) { const n = parseFloat(value); return isNaN(n) ? value : n; } const RULES = {}; /** * Adds a custom validator to the list of validation rules. */ function defineRule(id, validator) { // makes sure new rules are properly formatted. guardExtend(id, validator); RULES[id] = validator; } /** * Gets an already defined rule */ function resolveRule(id) { return RULES[id]; } /** * Guards from extension violations. */ function guardExtend(id, validator) { if (isCallable(validator)) { return; } throw new Error(`Extension Error: The validator '${id}' must be a function.`); } const FormContextKey = Symbol('vee-validate-form'); const FieldContextKey = Symbol('vee-validate-field-instance'); const IS_ABSENT = Symbol('Default empty value'); function isLocator(value) { return isCallable(value) && !!value.__locatorRef; } /** * Checks if an tag name is a native HTML tag and not a Vue component */ function isHTMLTag(tag) { return ['input', 'textarea', 'select'].includes(tag); } /** * Checks if an input is of type file */ function isFileInputNode(tag, attrs) { return isHTMLTag(tag) && attrs.type === 'file'; } function isYupValidator(value) { return !!value && isCallable(value.validate); } function hasCheckedAttr(type) { return type === 'checkbox' || type === 'radio'; } function isContainerValue(value) { return isObject(value) || Array.isArray(value); } /** * True if the value is an empty object or array */ function isEmptyContainer(value) { if (Array.isArray(value)) { return value.length === 0; } return isObject(value) && Object.keys(value).length === 0; } /** * Checks if the path opted out of nested fields using `[fieldName]` syntax */ function isNotNestedPath(path) { return /^\[.+\]$/i.test(path); } /** * Checks if an element is a native HTML5 multi-select input element */ function isNativeMultiSelect(el) { return isNativeSelect(el) && el.multiple; } /** * Checks if an element is a native HTML5 select input element */ function isNativeSelect(el) { return el.tagName === 'SELECT'; } /** * Checks if a tag name with attrs object will render a native multi-select element */ function isNativeMultiSelectNode(tag, attrs) { // The falsy value array is the values that Vue won't add the `multiple` prop if it has one of these values const hasTruthyBindingValue = ![false, null, undefined, 0].includes(attrs.multiple) && !Number.isNaN(attrs.multiple); return tag === 'select' && 'multiple' in attrs && hasTruthyBindingValue; } /** * Checks if a node should have a `:value` binding or not * * These nodes should not have a value binding * For files, because they are not reactive * For multi-selects because the value binding will reset the value */ function shouldHaveValueBinding(tag, attrs) { return isNativeMultiSelectNode(tag, attrs) || isFileInputNode(tag, attrs); } function isFormSubmitEvent(evt) { return isEvent(evt) && evt.target && 'submit' in evt.target; } function isEvent(evt) { if (!evt) { return false; } if (typeof Event !== 'undefined' && isCallable(Event) && evt instanceof Event) { return true; } // this is for IE and Cypress #3161 /* istanbul ignore next */ if (evt && evt.srcElement) { return true; } return false; } function isPropPresent(obj, prop) { return prop in obj && obj[prop] !== IS_ABSENT; } function cleanupNonNestedPath(path) { if (isNotNestedPath(path)) { return path.replace(/\[|\]/gi, ''); } return path; } function getFromPath(object, path, fallback) { if (!object) { return fallback; } if (isNotNestedPath(path)) { return object[cleanupNonNestedPath(path)]; } const resolvedValue = (path || '') .split(/\.|\[(\d+)\]/) .filter(Boolean) .reduce((acc, propKey) => { if (isContainerValue(acc) && propKey in acc) { return acc[propKey]; } return fallback; }, object); return resolvedValue; } /** * Sets a nested property value in a path, creates the path properties if it doesn't exist */ function setInPath(object, path, value) { if (isNotNestedPath(path)) { object[cleanupNonNestedPath(path)] = value; return; } const keys = path.split(/\.|\[(\d+)\]/).filter(Boolean); let acc = object; for (let i = 0; i < keys.length; i++) { // Last key, set it if (i === keys.length - 1) { acc[keys[i]] = value; return; } // Key does not exist, create a container for it if (!(keys[i] in acc) || isNullOrUndefined(acc[keys[i]])) { // container can be either an object or an array depending on the next key if it exists acc[keys[i]] = isIndex(keys[i + 1]) ? [] : {}; } acc = acc[keys[i]]; } } function unset(object, key) { if (Array.isArray(object) && isIndex(key)) { object.splice(Number(key), 1); return; } if (isObject(object)) { delete object[key]; } } /** * Removes a nested property from object */ function unsetPath(object, path) { if (isNotNestedPath(path)) { delete object[cleanupNonNestedPath(path)]; return; } const keys = path.split(/\.|\[(\d+)\]/).filter(Boolean); let acc = object; for (let i = 0; i < keys.length; i++) { // Last key, unset it if (i === keys.length - 1) { unset(acc, keys[i]); break; } // Key does not exist, exit if (!(keys[i] in acc) || isNullOrUndefined(acc[keys[i]])) { break; } acc = acc[keys[i]]; } const pathValues = keys.map((_, idx) => { return getFromPath(object, keys.slice(0, idx).join('.')); }); for (let i = pathValues.length - 1; i >= 0; i--) { if (!isEmptyContainer(pathValues[i])) { continue; } if (i === 0) { unset(object, keys[0]); continue; } unset(pathValues[i - 1], keys[i - 1]); } } /** * A typed version of Object.keys */ function keysOf(record) { return Object.keys(record); } // Uses same component provide as its own injections // Due to changes in https://github.com/vuejs/vue-next/pull/2424 function injectWithSelf(symbol, def = undefined) { const vm = vue.getCurrentInstance(); return (vm === null || vm === void 0 ? void 0 : vm.provides[symbol]) || vue.inject(symbol, def); } function warn(message) { vue.warn(`[vee-validate]: ${message}`); } /** * Ensures we deal with a singular field value */ function normalizeField(field) { if (Array.isArray(field)) { return field[0]; } return field; } function resolveNextCheckboxValue(currentValue, checkedValue, uncheckedValue) { if (Array.isArray(currentValue)) { const newVal = [...currentValue]; const idx = newVal.indexOf(checkedValue); idx >= 0 ? newVal.splice(idx, 1) : newVal.push(checkedValue); return newVal; } return currentValue === checkedValue ? uncheckedValue : checkedValue; } function debounceAsync(inner, ms = 0) { let timer = null; let resolves = []; return function (...args) { // Run the function after a certain amount of time if (timer) { window.clearTimeout(timer); } timer = window.setTimeout(() => { // Get the result of the inner function, then apply it to the resolve function of // each promise that has been created since the last time the inner function was run const result = inner(...args); resolves.forEach(r => r(result)); resolves = []; }, ms); return new Promise(resolve => resolves.push(resolve)); }; } // eslint-disable-next-line @typescript-eslint/no-explicit-any const normalizeChildren = (tag, context, slotProps) => { if (!context.slots.default) { return context.slots.default; } if (typeof tag === 'string' || !tag) { return context.slots.default(slotProps()); } return { default: () => { var _a, _b; return (_b = (_a = context.slots).default) === null || _b === void 0 ? void 0 : _b.call(_a, slotProps()); }, }; }; /** * Vue adds a `_value` prop at the moment on the input elements to store the REAL value on them, real values are different than the `value` attribute * as they do not get casted to strings unlike `el.value` which preserves user-code behavior */ function getBoundValue(el) { if (hasValueBinding(el)) { return el._value; } return undefined; } /** * Vue adds a `_value` prop at the moment on the input elements to store the REAL value on them, real values are different than the `value` attribute * as they do not get casted to strings unlike `el.value` which preserves user-code behavior */ function hasValueBinding(el) { return '_value' in el; } function normalizeEventValue(value) { if (!isEvent(value)) { return value; } const input = value.target; // Vue sets the current bound value on `_value` prop // for checkboxes it it should fetch the value binding type as is (boolean instead of string) if (hasCheckedAttr(input.type) && hasValueBinding(input)) { return getBoundValue(input); } if (input.type === 'file' && input.files) { return Array.from(input.files); } if (isNativeMultiSelect(input)) { return Array.from(input.options) .filter(opt => opt.selected && !opt.disabled) .map(getBoundValue); } // makes sure we get the actual `option` bound value // #3440 if (isNativeSelect(input)) { const selectedOption = Array.from(input.options).find(opt => opt.selected); return selectedOption ? getBoundValue(selectedOption) : input.value; } return input.value; } /** * Normalizes the given rules expression. */ function normalizeRules(rules) { const acc = {}; Object.defineProperty(acc, '_$$isNormalized', { value: true, writable: false, enumerable: false, configurable: false, }); if (!rules) { return acc; } // Object is already normalized, skip. if (isObject(rules) && rules._$$isNormalized) { return rules; } if (isObject(rules)) { return Object.keys(rules).reduce((prev, curr) => { const params = normalizeParams(rules[curr]); if (rules[curr] !== false) { prev[curr] = buildParams(params); } return prev; }, acc); } /* istanbul ignore if */ if (typeof rules !== 'string') { return acc; } return rules.split('|').reduce((prev, rule) => { const parsedRule = parseRule(rule); if (!parsedRule.name) { return prev; } prev[parsedRule.name] = buildParams(parsedRule.params); return prev; }, acc); } /** * Normalizes a rule param. */ function normalizeParams(params) { if (params === true) { return []; } if (Array.isArray(params)) { return params; } if (isObject(params)) { return params; } return [params]; } function buildParams(provided) { const mapValueToLocator = (value) => { // A target param using interpolation if (typeof value === 'string' && value[0] === '@') { return createLocator(value.slice(1)); } return value; }; if (Array.isArray(provided)) { return provided.map(mapValueToLocator); } // #3073 if (provided instanceof RegExp) { return [provided]; } return Object.keys(provided).reduce((prev, key) => { prev[key] = mapValueToLocator(provided[key]); return prev; }, {}); } /** * Parses a rule string expression. */ const parseRule = (rule) => { let params = []; const name = rule.split(':')[0]; if (rule.includes(':')) { params = rule.split(':').slice(1).join(':').split(','); } return { name, params }; }; function createLocator(value) { const locator = (crossTable) => { const val = getFromPath(crossTable, value) || crossTable[value]; return val; }; locator.__locatorRef = value; return locator; } function extractLocators(params) { if (Array.isArray(params)) { return params.filter(isLocator); } return keysOf(params) .filter(key => isLocator(params[key])) .map(key => params[key]); } const DEFAULT_CONFIG = { generateMessage: ({ field }) => `${field} is not valid.`, bails: true, validateOnBlur: true, validateOnChange: true, validateOnInput: false, validateOnModelUpdate: true, }; let currentConfig = Object.assign({}, DEFAULT_CONFIG); const getConfig = () => currentConfig; const setConfig = (newConf) => { currentConfig = Object.assign(Object.assign({}, currentConfig), newConf); }; const configure = setConfig; /** * Validates a value against the rules. */ async function validate(value, rules, options = {}) { const shouldBail = options === null || options === void 0 ? void 0 : options.bails; const field = { name: (options === null || options === void 0 ? void 0 : options.name) || '{field}', rules, bails: shouldBail !== null && shouldBail !== void 0 ? shouldBail : true, formData: (options === null || options === void 0 ? void 0 : options.values) || {}, }; const result = await _validate(field, value); const errors = result.errors; return { errors, valid: !errors.length, }; } /** * Starts the validation process. */ async function _validate(field, value) { if (isYupValidator(field.rules)) { return validateFieldWithYup(value, field.rules, { bails: field.bails }); } // if a generic function, use it as the pipeline. if (isCallable(field.rules)) { const ctx = { field: field.name, form: field.formData, value: value, }; const result = await field.rules(value, ctx); const isValid = typeof result !== 'string' && result; const message = typeof result === 'string' ? result : _generateFieldError(ctx); return { errors: !isValid ? [message] : [], }; } const normalizedContext = Object.assign(Object.assign({}, field), { rules: normalizeRules(field.rules) }); const errors = []; const rulesKeys = Object.keys(normalizedContext.rules); const length = rulesKeys.length; for (let i = 0; i < length; i++) { const rule = rulesKeys[i]; const result = await _test(normalizedContext, value, { name: rule, params: normalizedContext.rules[rule], }); if (result.error) { errors.push(result.error); if (field.bails) { return { errors, }; } } } return { errors, }; } /** * Handles yup validation */ async function validateFieldWithYup(value, validator, opts) { var _a; const errors = await validator .validate(value, { abortEarly: (_a = opts.bails) !== null && _a !== void 0 ? _a : true, }) .then(() => []) .catch((err) => { // Yup errors have a name prop one them. // https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string if (err.name === 'ValidationError') { return err.errors; } // re-throw the error so we don't hide it throw err; }); return { errors, }; } /** * Tests a single input value against a rule. */ async function _test(field, value, rule) { const validator = resolveRule(rule.name); if (!validator) { throw new Error(`No such validator '${rule.name}' exists.`); } const params = fillTargetValues(rule.params, field.formData); const ctx = { field: field.name, value, form: field.formData, rule: Object.assign(Object.assign({}, rule), { params }), }; const result = await validator(value, params, ctx); if (typeof result === 'string') { return { error: result, }; } return { error: result ? undefined : _generateFieldError(ctx), }; } /** * Generates error messages. */ function _generateFieldError(fieldCtx) { const message = getConfig().generateMessage; if (!message) { return 'Field is invalid'; } return message(fieldCtx); } function fillTargetValues(params, crossTable) { const normalize = (value) => { if (isLocator(value)) { return value(crossTable); } return value; }; if (Array.isArray(params)) { return params.map(normalize); } return Object.keys(params).reduce((acc, param) => { acc[param] = normalize(params[param]); return acc; }, {}); } async function validateYupSchema(schema, values) { const errorObjects = await schema .validate(values, { abortEarly: false }) .then(() => []) .catch((err) => { // Yup errors have a name prop one them. // https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string if (err.name !== 'ValidationError') { throw err; } // list of aggregated errors return err.inner || []; }); const results = {}; const errors = {}; for (const error of errorObjects) { const messages = error.errors; results[error.path] = { valid: !messages.length, errors: messages }; if (messages.length) { errors[error.path] = messages[0]; } } return { valid: !errorObjects.length, results, errors, }; } async function validateObjectSchema(schema, values, opts) { const paths = keysOf(schema); const validations = paths.map(async (path) => { var _a, _b, _c; const fieldResult = await validate(getFromPath(values, path), schema[path], { name: ((_a = opts === null || opts === void 0 ? void 0 : opts.names) === null || _a === void 0 ? void 0 : _a[path]) || path, values: values, bails: (_c = (_b = opts === null || opts === void 0 ? void 0 : opts.bailsMap) === null || _b === void 0 ? void 0 : _b[path]) !== null && _c !== void 0 ? _c : true, }); return Object.assign(Object.assign({}, fieldResult), { path }); }); let isAllValid = true; const validationResults = await Promise.all(validations); const results = {}; const errors = {}; for (const result of validationResults) { results[result.path] = { valid: result.valid, errors: result.errors, }; if (!result.valid) { isAllValid = false; errors[result.path] = result.errors[0]; } } return { valid: isAllValid, results, errors, }; } function set(obj, key, val) { if (typeof val.value === 'object') val.value = klona(val.value); if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') { Object.defineProperty(obj, key, val); } else obj[key] = val.value; } function klona(x) { if (typeof x !== 'object') return x; var i=0, k, list, tmp, str=Object.prototype.toString.call(x); if (str === '[object Object]') { tmp = Object.create(x.__proto__ || null); } else if (str === '[object Array]') { tmp = Array(x.length); } else if (str === '[object Set]') { tmp = new Set; x.forEach(function (val) { tmp.add(klona(val)); }); } else if (str === '[object Map]') { tmp = new Map; x.forEach(function (val, key) { tmp.set(klona(key), klona(val)); }); } else if (str === '[object Date]') { tmp = new Date(+x); } else if (str === '[object RegExp]') { tmp = new RegExp(x.source, x.flags); } else if (str === '[object DataView]') { tmp = new x.constructor( klona(x.buffer) ); } else if (str === '[object ArrayBuffer]') { tmp = x.slice(0); } else if (str.slice(-6) === 'Array]') { // ArrayBuffer.isView(x) // ~> `new` bcuz `Buffer.slice` => ref tmp = new x.constructor(x); } if (tmp) { for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) { set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i])); } for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) { if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue; set(tmp, k, Object.getOwnPropertyDescriptor(x, k)); } } return tmp || x; } var es6 = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if ((a instanceof Map) && (b instanceof Map)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false; return true; } if ((a instanceof Set) && (b instanceof Set)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; return true; } if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; let ID_COUNTER = 0; function useFieldState(path, init) { const { value, initialValue, setInitialValue } = _useFieldValue(path, init.modelValue, !init.standalone); const { errorMessage, errors, setErrors } = _useFieldErrors(path, !init.standalone); const meta = _useFieldMeta(value, initialValue, errors); const id = ID_COUNTER >= Number.MAX_SAFE_INTEGER ? 0 : ++ID_COUNTER; function setState(state) { var _a; if ('value' in state) { value.value = state.value; } if ('errors' in state) { setErrors(state.errors); } if ('touched' in state) { meta.touched = (_a = state.touched) !== null && _a !== void 0 ? _a : meta.touched; } if ('initialValue' in state) { setInitialValue(state.initialValue); } } return { id, path, value, initialValue, meta, errors, errorMessage, setState, }; } /** * Creates the field value and resolves the initial value */ function _useFieldValue(path, modelValue, shouldInjectForm) { const form = shouldInjectForm ? injectWithSelf(FormContextKey, undefined) : undefined; const modelRef = vue.ref(vue.unref(modelValue)); function resolveInitialValue() { if (!form) { return vue.unref(modelRef); } return getFromPath(form.meta.value.initialValues, vue.unref(path), vue.unref(modelRef)); } function setInitialValue(value) { if (!form) { modelRef.value = value; return; } form.setFieldInitialValue(vue.unref(path), value); } const initialValue = vue.computed(resolveInitialValue); // if no form is associated, use a regular ref. if (!form) { const value = vue.ref(resolveInitialValue()); return { value, initialValue, setInitialValue, }; } // to set the initial value, first check if there is a current value, if there is then use it. // otherwise use the configured initial value if it exists. // prioritize model value over form values // #3429 const currentValue = modelValue ? vue.unref(modelValue) : getFromPath(form.values, vue.unref(path), vue.unref(initialValue)); form.stageInitialValue(vue.unref(path), currentValue); // otherwise use a computed setter that triggers the `setFieldValue` const value = vue.computed({ get() { return getFromPath(form.values, vue.unref(path)); }, set(newVal) { form.setFieldValue(vue.unref(path), newVal); }, }); return { value, initialValue, setInitialValue, }; } /** * Creates meta flags state and some associated effects with them */ function _useFieldMeta(currentValue, initialValue, errors) { const meta = vue.reactive({ touched: false, pending: false, valid: true, validated: !!vue.unref(errors).length, initialValue: vue.computed(() => vue.unref(initialValue)), dirty: vue.computed(() => { return !es6(vue.unref(currentValue), vue.unref(initialValue)); }), }); vue.watch(errors, value => { meta.valid = !value.length; }, { immediate: true, flush: 'sync', }); return meta; } /** * Creates the error message state for the field state */ function _useFieldErrors(path, shouldInjectForm) { const form = shouldInjectForm ? injectWithSelf(FormContextKey, undefined) : undefined; function normalizeErrors(messages) { if (!messages) { return []; } return Array.isArray(messages) ? messages : [messages]; } if (!form) { const errors = vue.ref([]); return { errors, errorMessage: vue.computed(() => errors.value[0]), setErrors: (messages) => { errors.value = normalizeErrors(messages); }, }; } const errors = vue.computed(() => form.errorBag.value[vue.unref(path)] || []); return { errors, errorMessage: vue.computed(() => errors.value[0]), setErrors: (messages) => { form.setFieldErrorBag(vue.unref(path), normalizeErrors(messages)); }, }; } /** * Creates a field composite. */ function useField(name, rules, opts) { if (hasCheckedAttr(opts === null || opts === void 0 ? void 0 : opts.type)) { return useCheckboxField(name, rules, opts); } return _useField(name, rules, opts); } function _useField(name, rules, opts) { const { initialValue: modelValue, validateOnMount, bails, type, checkedValue, label, validateOnValueUpdate, uncheckedValue, standalone, } = normalizeOptions(vue.unref(name), opts); const form = !standalone ? injectWithSelf(FormContextKey) : undefined; const { id, value, initialValue, meta, setState, errors, errorMessage } = useFieldState(name, { modelValue, standalone, }); /** * Handles common onBlur meta update */ const handleBlur = () => { meta.touched = true; }; const normalizedRules = vue.computed(() => { let rulesValue = vue.unref(rules); const schema = vue.unref(form === null || form === void 0 ? void 0 : form.schema); if (schema && !isYupValidator(schema)) { rulesValue = extractRuleFromSchema(schema, vue.unref(name)) || rulesValue; } if (isYupValidator(rulesValue) || isCallable(rulesValue)) { return rulesValue; } return normalizeRules(rulesValue); }); async function validateCurrentValue(mode) { var _a, _b; if (form === null || form === void 0 ? void 0 : form.validateSchema) { return (_a = (await form.validateSchema(mode)).results[vue.unref(name)]) !== null && _a !== void 0 ? _a : { valid: true, errors: [] }; } return validate(value.value, normalizedRules.value, { name: vue.unref(label) || vue.unref(name), values: (_b = form === null || form === void 0 ? void 0 : form.values) !== null && _b !== void 0 ? _b : {}, bails, }); } async function validateWithStateMutation() { meta.pending = true; meta.validated = true; const result = await validateCurrentValue('validated-only'); setState({ errors: result.errors }); meta.pending = false; return result; } async function validateValidStateOnly() { const result = await validateCurrentValue('silent'); meta.valid = result.valid; return result; } function validate$1(opts) { if (!(opts === null || opts === void 0 ? void 0 : opts.mode) || (opts === null || opts === void 0 ? void 0 : opts.mode) === 'force') { return validateWithStateMutation(); } if ((opts === null || opts === void 0 ? void 0 : opts.mode) === 'validated-only') { return validateWithStateMutation(); } return validateValidStateOnly(); } // Common input/change event handler const handleChange = (e, shouldValidate = true) => { const newValue = normalizeEventValue(e); value.value = newValue; if (!validateOnValueUpdate && shouldValidate) { validateWithStateMutation(); } }; // Runs the initial validation vue.onMounted(() => { if (validateOnMount) { return validateWithStateMutation(); } // validate self initially if no form was handling this // forms should have their own initial silent validation run to make things more efficient if (!form || !form.validateSchema) { validateValidStateOnly(); } }); function setTouched(isTouched) { meta.touched = isTouched; } let unwatchValue; function watchValue() { unwatchValue = vue.watch(value, validateOnValueUpdate ? validateWithStateMutation : validateValidStateOnly, { deep: true, }); } watchValue(); function resetField(state) { var _a; unwatchValue === null || unwatchValue === void 0 ? void 0 : unwatchValue(); const newValue = state && 'value' in state ? state.value : initialValue.value; setState({ value: klona(newValue), initialValue: klona(newValue), touched: (_a = state === null || state === void 0 ? void 0 : state.touched) !== null && _a !== void 0 ? _a : false, errors: (state === null || state === void 0 ? void 0 : state.errors) || [], }); meta.pending = false; meta.validated = false; validateValidStateOnly(); // need to watch at next tick to avoid triggering the value watcher vue.nextTick(() => { watchValue(); }); } function setValue(newValue) { value.value = newValue; } function setErrors(errors) { setState({ errors: Array.isArray(errors) ? errors : [errors] }); } const field = { id, name, label, value, meta, errors, errorMessage, type, checkedValue, uncheckedValue, bails, resetField, handleReset: () => resetField(), validate: validate$1, handleChange, handleBlur, setState, setTouched, setErrors, setValue, }; vue.provide(FieldContextKey, field); if (vue.isRef(rules) && typeof vue.unref(rules) !== 'function') { vue.watch(rules, (value, oldValue) => { if (es6(value, oldValue)) { return; } meta.validated ? validateWithStateMutation() : validateValidStateOnly(); }, { deep: true, }); } // if no associated form return the field API immediately if (!form) { return field; } // associate the field with the given form form.register(field); vue.onBeforeUnmount(() => { form.unregister(field); }); // extract cross-field dependencies in a computed prop const dependencies = vue.computed(() => { const rulesVal = normalizedRules.value; // is falsy, a function schema or a yup schema if (!rulesVal || isCallable(rulesVal) || isYupValidator(rulesVal)) { return {}; } return Object.keys(rulesVal).reduce((acc, rule) => { const deps = extractLocators(rulesVal[rule]) .map((dep) => dep.__locatorRef) .reduce((depAcc, depName) => { const depValue = getFromPath(form.values, depName) || form.values[depName]; if (depValue !== undefined) { depAcc[depName] = depValue; } return depAcc; }, {}); Object.assign(acc, deps); return acc; }, {}); }); // Adds a watcher that runs the validation whenever field dependencies change vue.watch(dependencies, (deps, oldDeps) => { // Skip if no dependencies or if the field wasn't manipulated if (!Object.keys(deps).length) { return; } const shouldValidate = !es6(deps, oldDeps); if (shouldValidate) { meta.validated ? validateWithStateMutation() : validateValidStateOnly(); } }); return field; } /** * Normalizes partial field options to include the full options */ function normalizeOptions(name, opts) { const defaults = () => ({ initialValue: undefined, validateOnMount: false, bails: true, rules: '', label: name, validateOnValueUpdate: true, standalone: false, }); if (!opts) { return defaults(); } // TODO: Deprecate this in next major release const checkedValue = 'valueProp' in opts ? opts.valueProp : opts.checkedValue; return Object.assign(Object.assign(Object.assign({}, defaults()), (opts || {})), { checkedValue }); } /** * Extracts the validation rules from a schema */ function extractRuleFromSchema(schema, fieldName) { // no schema at all if (!schema) { return undefined; } // there is a key on the schema object for this field return schema[fieldName]; } function useCheckboxField(name, rules, opts) { const form = !(opts === null || opts === void 0 ? void 0 : opts.standalone) ? injectWithSelf(FormContextKey) : undefined; const checkedValue = opts === null || opts === void 0 ? void 0 : opts.checkedValue; const uncheckedValue = opts === null || opts === void 0 ? void 0 : opts.uncheckedValue; function patchCheckboxApi(field) { const handleChange = field.handleChange; const checked = vue.computed(() => { const currentValue = vue.unref(field.value); const checkedVal = vue.unref(checkedValue); return Array.isArray(currentValue) ? currentValue.includes(checkedVal) : checkedVal === currentValue; }); function handleCheckboxChange(e, shouldValidate = true) { var _a, _b; if (checked.value === ((_b = (_a = e) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.checked)) { return; } let newValue = normalizeEventValue(e); // Single checkbox field without a form to toggle it's value if (!form) { newValue = resolveNextCheckboxValue(vue.unref(field.value), vue.unref(checkedValue), vue.unref(uncheckedValue)); } handleChange(newValue, shouldValidate); } vue.onBeforeUnmount(() => { // toggles the checkbox value if it was checked if (checked.value) { handleCheckboxChange(vue.unref(checkedValue), false); } }); return Object.assign(Object.assign({}, field), { checked, checkedValue, uncheckedValue, handleChange: handleCheckboxChange }); } return patchCheckboxApi(_useField(name, rules, opts)); } const FieldImpl = vue.defineComponent({ name: 'Field', inheritAttrs: false, props: { as: { type: [String, Object], default: undefined, }, name: { type: String, required: true, }, rules: { type: [Object, String, Function], default: undefined, }, validateOnMount: { type: Boolean, default: false, }, validateOnBlur: { type: Boolean, default: undefined, }, validateOnChange: { type: Boolean, default: undefined, }, validateOnInput: { type: Boolean, default: undefined, }, validateOnModelUpdate: { type: Boolean, default: undefined, }, bails: { type: Boolean, default: () => getConfig().bails, }, label: { type: String, default: undefined, }, uncheckedValue: { type: null, default: undefined, }, modelValue: { type: null, default: IS_ABSENT, }, modelModifiers: { type: null, default: () => ({}), }, 'onUpdate:modelValue': { type: null, default: undefined, }, standalone: { type: Boolean, default: false, }, }, setup(props, ctx) { const rules = vue.toRef(props, 'rules'); const name = vue.toRef(props, 'name'); const label = vue.toRef(props, 'label'); const uncheckedValue = vue.toRef(props, 'uncheckedValue'); const hasModelEvents = isPropPresent(props, 'onUpdate:modelValue'); const { errors, value, errorMessage, validate: validateField, handleChange, handleBlur, setTouched, resetField, handleReset, meta, checked, setErrors, } = useField(name, rules, { validateOnMount: props.validateOnMount, bails: props.bails, standalone: props.standalone, type: ctx.attrs.type, initialValue: resolveInitialValue(props, ctx), // Only for checkboxes and radio buttons checkedValue: ctx.attrs.value, uncheckedValue, label, validateOnValueUpdate: false, }); // If there is a v-model applied on the component we need to emit the `update:modelValue` whenever the value binding changes const onChangeHandler = hasModelEvents ? function handleChangeWithModel(e, shouldValidate = true) { handleChange(e, shouldValidate); ctx.emit('update:modelValue', value.value); } : handleChange; const handleInput = (e) => { if (!hasCheckedAttr(ctx.attrs.type)) { value.value = normalizeEventValue(e); } }; const onInputHandler = hasModelEvents ? function handleInputWithModel(e) { handleInput(e); ctx.emit('update:modelValue', value.value); } : handleInput; const fieldProps = vue.computed(() => { const { validateOnInput, validateOnChange, validateOnBlur, validateOnModelUpdate } = resolveValidationTriggers(props); const baseOnBlur = [handleBlur, ctx.attrs.onBlur, validateOnBlur ? validateField : undefined].filter(Boolean); const baseOnInput = [(e) => onChangeHandler(e, validateOnInput), ctx.attrs.onInput].filter(Boolean); const baseOnChange = [(e) => onChangeHandler(e, validateOnChange), ctx.attrs.onChange].filter(Boolean); const attrs = { name: props.name, onBlur: baseOnBlur, onInput: baseOnInput, onChange: baseOnChange, }; if (validateOnModelUpdate) { attrs['onUpdate:modelValue'] = [onChangeHandler]; } if (hasCheckedAttr(ctx.attrs.type) && checked) { attrs.checked = checked.value; } else { attrs.value = value.value; } const tag = resolveTag(props, ctx); if (shouldHaveValueBinding(tag, ctx.attrs)) { delete attrs.value; } return attrs; }); const modelValue = vue.toRef(props, 'modelValue'); vue.watch(modelValue, newModelValue => { // Don't attempt to sync absent values if (newModelValue === IS_ABSENT && value.value === undefined) { return; } if (newModelValue !== applyModifiers(value.value, props.modelModifiers)) { value.value = newModelValue === IS_ABSENT ? undefined : newModelValue; validateField(); } }); function slotProps() { return { field: fieldProps.value, value: value.value, meta, errors: errors.value, errorMessage: errorMessage.value, validate: validateField, resetField, handleChange: onChangeHandler, handleInput: onInputHandler, handleReset, handleBlur, setTouched, setErrors, }; } ctx.expose({ setErrors, setTouched, reset: resetField, validate: validateField, handleChange, }); return () => { const tag = vue.resolveDynamicComponent(resolveTag(props, ctx)); const children = normalizeChildren(tag, ctx, slotProps); if (tag) { return vue.h(tag, Object.assign(Object.assign({}, ctx.attrs), fieldProps.value), children); } return children; }; }, }); function resolveTag(props, ctx) { let tag = props.as || ''; if (!props.as && !ctx.slots.default) { tag = 'input'; } return tag; } function resolveValidationTriggers(props) { var _a, _b, _c, _d; const { validateOnInput, validateOnChange, validateOnBlur, validateOnModelUpdate } = getConfig(); return { validateOnInput: (_a = props.validateOnInput) !== null && _a !== void 0 ? _a : validateOnInput, validateOnChange: (_b = props.validateOnChange) !== null && _b !== void 0 ? _b : validateOnChange, validateOnBlur: (_c = props.validateOnBlur) !== null && _c !== void 0 ? _c : validateOnBlur, validateOnModelUpdate: (_d = props.validateOnModelUpdate) !== null && _d !== void 0 ? _d : validateOnModelUpdate, }; } function applyModifiers(value, modifiers) { if (modifiers.number) { return toNumber(value); } return value; } function resolveInitialValue(props, ctx) { // Gets the initial value either from `value` prop/attr or `v-model` binding (modelValue) // For checkboxes and radio buttons it will always be the model value not the `value` attribute if (!hasCheckedAttr(ctx.attrs.type)) { return isPropPresent(props, 'modelValue') ? props.modelValue : ctx.attrs.value; } return isPropPresent(props, 'modelValue') ? props.modelValue : undefined; } const Field = FieldImpl; let FORM_COUNTER = 0; function useForm(opts) { const formId = FORM_COUNTER++; // Prevents fields from double resetting their values, which causes checkboxes to toggle their initial value // TODO: This won't be needed if we centralize all the state inside the `form` for form inputs let RESET_LOCK = false; // A lookup containing fields or field groups const fieldsByPath = vue.ref({}); // If the form is currently submitting const isSubmitting = vue.ref(false); // The number of times the user tried to submit the form const submitCount = vue.ref(0); // dictionary for field arrays to receive various signals like reset const fieldArraysLookup = {}; // a private ref for all form values const formValues = vue.reactive(klona(vue.unref(opts === null || opts === void 0 ? void 0 : opts.initialValues) || {})); // the source of errors for the form fields const { errorBag, setErrorBag, setFieldErrorBag } = useErrorBag(opts === null || opts === void 0 ? void 0 : opts.initialErrors); // Gets the first error of each field const errors = vue.computed(() => { return keysOf(errorBag.value).reduce((acc, key) => { const bag = errorBag.value[key]; if (bag && bag.length) { acc[key] = bag[0]; } return acc; }, {}); }); function getFirstFieldAtPath(path) { const fieldOrGroup = fieldsByPath.value[path]; return Array.isArray(fieldOrGroup) ? fieldOrGroup[0] : fieldOrGroup; } function fieldExists(path) { return !!fieldsByPath.value[path]; } /** * Holds a computed reference to all fields names and labels */ const fieldNames = vue.computed(() => { return keysOf(fieldsByPath.value).reduce((names, path) => { const field = getFirstFieldAtPath(path); if (field) { names[path] = vue.unref(field.label || field.name) || ''; } return names; }, {}); }); const fieldBailsMap = vue.computed(() => { return keysOf(fieldsByPath.value).reduce((map, path) => { var _a; const field = getFirstFieldAtPath(path); if (field) { map[path] = (_a = field.bails) !== null && _a !== void 0 ? _a : true; } return map; }, {}); }); // mutable non-reactive reference to initial errors // we need this to process initial errors then unset them const initialErrors = Object.assign({}, ((opts === null || opts === void 0 ? void 0 : opts.initialErrors) || {})); // initial form values const { initialValues, originalInitialValues, setInitialValues } = useFormInitialValues(fieldsByPath, formValues, opts === null || opts === void 0 ? void 0 : opts.initialValues); // form meta aggregations const meta = useFormMeta(fieldsByPath, formValues, initialValues, errors); const schema = opts === null || opts === void 0 ? void 0 : opts.validationSchema; const formCtx = { formId, fieldsByPath, values: formValues, errorBag, errors, schema, submitCount, meta, isSubmitting, fieldArraysLookup, validateSchema: vue.unref(schema) ? validateSchema : undefined, validate, register: registerField, unregister: unregisterField, setFieldErrorBag, validateField, setFieldValue, setValues, setErrors, setFieldError, setFieldTouched, setTouched, resetForm, handleSubmit, stageInitialValue, unsetInitialValue, setFieldInitialValue, }; function isFieldGroup(fieldOrGroup) { return Array.isArray(fieldOrGroup); } function applyFieldMutation(fieldOrGroup, mutation) { if (Array.isArray(fieldOrGroup)) { return fieldOrGroup.forEach(mutation); } return mutation(fieldOrGroup); } /** * Manually sets an error message on a specific field */ function setFieldError(field, message) { setFieldErrorBag(field, message); } /** * Sets errors for the fields specified in the object */ function setErrors(fields) { setErrorBag(fields); } /** * Sets a single field value */ function setFieldValue(field, value, { force } = { force: false }) { var _a; const fieldInstance = fieldsByPath.value[field]; const clonedValue = klona(value); // field wasn't found, create a virtual field as a placeholder if (!fieldInstance) { setInPath(formValues, field, clonedValue); return; } if (isFieldGroup(fieldInstance) && ((_a = fieldInstance[0]) === null || _a === void 0 ? void 0 : _a.type) === 'checkbox' && !Array.isArray(value)) { // Multiple checkboxes, and only one of them got updated const newValue = klona(resolveNextCheckboxValue(getFromPath(formValues, field) || [], value, undefined)); setInPath(formValues, field, newValue); return; } let newValue = value; // Single Checkbox: toggles the field value unless the field is being reset then force it if (!isFieldGroup(fieldInstance) && fieldInstance.type === 'checkbox' && !force && !RESET_LOCK) { newValue = klona(resolveNextCheckboxValue(getFromPath(formValues, field), value, vue.unref(fieldInstance.uncheckedValue))); } setInPath(formValues, field, newValue); } /** * Sets multiple fields values */ function setValues(fields) { // clean up old values keysOf(formValues).forEach(key => { delete formValues[key]; }); // set up new values keysOf(fields).forEach(path => { setFieldValue(path, fields[path]); }); // regenerate the arrays when the form values change Object.values(fieldArraysLookup).forEach(f => f && f.reset()); } /** * Sets the touched meta state on a field */ function setFieldTouched(field, isTouched) { const fieldInstance = fieldsByPath.value[field]; if (fieldInstance) { applyFieldMutation(fieldInstance, f => f.setTouched(isTouched)); } } /** * Sets the touched meta state on multiple fields */ function setTouched(fields) { keysOf(fields).forEach(field => { setFieldTouched(field, !!fields[field]); }); } /** * Resets all fields */ function resetForm(state) { RESET_LOCK = true; // set initial values if provided if (state === null || state === void 0 ? void 0 : state.values) { setInitialValues(state.values); setValues(state === null || state === void 0 ? void 0 : state.values); } else { // clean up the initial values back to the original setInitialValues(originalInitialValues.value); // otherwise clean the current values setValues(originalInitialValues.value); } Object.values(fieldsByPath.value).forEach(field => { if (!field) { return; } // avoid resetting the field values, because they should've been reset already. applyFieldMutation(field, f => f.resetField()); }); if (state === null || state === void 0 ? void 0 : state.touched) { setTouched(state.touched); } setErrors((state === null || state === void 0 ? void 0 : state.errors) || {}); submitCount.value = (state === null || state === void 0 ? void 0 : state.submitCount) || 0; vue.nextTick(() => { RESET_LOCK = false; }); } function insertFieldAtPath(field, path) { const rawField = vue.markRaw(field); const fieldPath = path; // first field at that path if (!fieldsByPath.value[fieldPath]) { fieldsByPath.value[fieldPath] = rawField; return; } const fieldAtPath = fieldsByPath.value[fieldPath]; if (fieldAtPath && !Array.isArray(fieldAtPath)) { fieldsByPath.value[fieldPath] = [fieldAtPath]; } // add the new array to that path fieldsByPath.value[fieldPath] = [...fieldsByPath.value[fieldPath], rawField]; } function removeFieldFromPath(field, path) { const fieldPath = path; const fieldAtPath = fieldsByPath.value[fieldPath]; if (!fieldAtPath) { return; } // same field at path if (!isFieldGroup(fieldAtPath) && field.id === fieldAtPath.id) { delete fieldsByPath.value[fieldPath]; return; } if (isFieldGroup(fieldAtPath)) { const idx = fieldAtPath.findIndex(f => f.id === field.id); if (idx === -1) { return; } fieldAtPath.splice(idx, 1); if (fieldAtPath.length === 1) { fieldsByPath.value[fieldPath] = fieldAtPath[0]; return; } if (!fieldAtPath.length) { delete fieldsByPath.value[fieldPath]; } } } function registerField(field) { const fieldPath = vue.unref(field.name); insertFieldAtPath(field, fieldPath); if (vue.isRef(field.name)) { // ensures when a field's name was already taken that it preserves its same value // necessary for fields generated by loops vue.watch(field.name, async (newPath, oldPath) => { // cache the value await vue.nextTick(); removeFieldFromPath(field, oldPath); insertFieldAtPath(field, newPath); // re-validate if either path had errors before if (errors.value[oldPath] || errors.value[newPath]) { validateField(newPath); } // clean up the old path if no other field is sharing that name // #3325 await vue.nextTick(); if (!fieldExists(oldPath)) { unsetPath(formValues, oldPath); } }); } // if field already had errors (initial errors) that's not user-set, validate it again to ensure state is correct // the difference being that `initialErrors` will contain the error message while other errors (pre-validated schema) won't have them as initial errors // #3342 const initialErrorMessage = vue.unref(field.errorMessage); if (initialErrorMessage && (initialErrors === null || initialErrors === void 0 ? void 0 : initialErrors[fieldPath]) !== initialErrorMessage) { validateField(fieldPath); } // marks the initial error as "consumed" so it won't be matched later with same non-initial error delete initialErrors[fieldPath]; } function unregisterField(field) { const fieldName = vue.unref(field.name); removeFieldFromPath(field, fieldName); vue.nextTick(() => { // clears a field error on unmounted // we wait till next tick to make sure if the field is completely removed and doesn't have any siblings like checkboxes // #3384 if (!fieldExists(fieldName)) { setFieldError(fieldName, undefined); unsetPath(formValues, fieldName); } }); } async function validate(opts) { if (formCtx.validateSchema) { return formCtx.validateSchema((opts === null || opts === void 0 ? void 0 : opts.mode) || 'force'); } // No schema, each field is responsible to validate itself const validations = await Promise.all(Object.values(fieldsByPath.value).map(field => { const fieldInstance = Array.isArray(field) ? field[0] : field; if (!fieldInstance) { return Promise.resolve({ key: '', valid: true, errors: [] }); } return fieldInstance.validate(opts).then((result) => { return { key: vue.unref(fieldInstance.name), valid: result.valid, errors: result.errors, }; }); })); const results = {}; const errors = {}; for (const validation of validations) { results[validation.key] = { valid: validation.valid, errors: validation.errors, }; if (validation.errors.length) { errors[validation.key] = validation.errors[0]; } } return { valid: validations.every(r => r.valid), results, errors, }; } async function validateField(field) { const fieldInstance = fieldsByPath.value[field]; if (!fieldInstance) { vue.warn(`field with name ${field} was not found`); return Promise.resolve({ errors: [], valid: true }); } if (Array.isArray(fieldInstance)) { return fieldInstance.map(f => f.validate())[0]; } return fieldInstance.validate(); } function handleSubmit(fn, onValidationError) { return function submissionHandler(e) { if (e instanceof Event) { e.preventDefault(); e.stopPropagation(); } // Touch all fields setTouched(keysOf(fieldsByPath.value).reduce((acc, field) => { acc[field] = true; return acc; }, {})); isSubmitting.value = true; submitCount.value++; return validate() .then(result => { if (result.valid && typeof fn === 'function') { return fn(klona(formValues), { evt: e, setErrors, setFieldError, setTouched, setFieldTouched, setValues, setFieldValue, resetForm, }); } if (!result.valid && typeof onValidationError === 'function') { onValidationError({ values: klona(formValues), evt: e, errors: result.errors, results: result.results, }); } }) .then(returnVal => { isSubmitting.value = false; return returnVal; }, err => { isSubmitting.value = false; // re-throw the err so it doesn't go silent throw err; }); }; } function setFieldInitialValue(path, value) { setInPath(initialValues.value, path, klona(value)); } function unsetInitialValue(path) { unsetPath(initialValues.value, path); } /** * Sneaky function to set initial field values */ function stageInitialValue(path, value) { setInPath(formValues, path, value); setFieldInitialValue(path, value); } async function _validateSchema() { const schemaValue = vue.unref(schema); if (!schemaValue) { return { valid: true, results: {}, errors: {} }; } const formResult = isYupValidator(schemaValue) ? await validateYupSchema(schemaValue, formValues) : await validateObjectSchema(schemaValue, formValues, { names: fieldNames.value, bailsMap: fieldBailsMap.value, }); return formResult; } /** * Batches validation runs in 5ms batches */ const debouncedSchemaValidation = debounceAsync(_validateSchema, 5); async function validateSchema(mode) { const formResult = await debouncedSchemaValidation(); // fields by id lookup const fieldsById = formCtx.fieldsByPath.value || {}; // errors fields names, we need it to also check if custom errors are updated const currentErrorsPaths = keysOf(formCtx.errorBag.value); // collect all the keys from the schema and all fields // this ensures we have a complete keymap of all the fields const paths = [ ...new Set([...keysOf(formResult.results), ...keysOf(fieldsById), ...currentErrorsPaths]), ]; // aggregates the paths into a single result object while applying the results on the fields return paths.reduce((validation, path) => { const field = fieldsById[path]; const messages = (formResult.results[path] || { errors: [] }).errors; const fieldResult = { errors: messages, valid: !messages.length, }; validation.results[path] = fieldResult; if (!fieldResult.valid) { validation.errors[path] = fieldResult.errors[0]; } // field not rendered if (!field) { setFieldError(path, messages); return validation; } // always update the valid flag regardless of the mode applyFieldMutation(field, f => (f.meta.valid = fieldResult.valid)); if (mode === 'silent') { return validation; } const wasValidated = Array.isArray(field) ? field.some(f => f.meta.validated) : field.meta.validated; if (mode === 'validated-only' && !wasValidated) { return validation; } applyFieldMutation(field, f => f.setState({ errors: fieldResult.errors })); return validation; }, { valid: formResult.valid, results: {}, errors: {} }); } const submitForm = handleSubmit((_, { evt }) => { if (isFormSubmitEvent(evt)) { evt.target.submit(); } }); // Trigger initial validation vue.onMounted(() => { if (opts === null || opts === void 0 ? void 0 : opts.initialErrors) { setErrors(opts.initialErrors); } if (opts === null || opts === void 0 ? void 0 : opts.initialTouched) { setTouched(opts.initialTouched); } // if validate on mount was enabled if (opts === null || opts === void 0 ? void 0 : opts.validateOnMount) { validate(); return; } // otherwise run initial silent validation through schema if available // the useField should skip their own silent validation if a yup schema is present if (formCtx.validateSchema) { formCtx.validateSchema('silent'); } }); if (vue.isRef(schema)) { vue.watch(schema, () => { var _a; (_a = formCtx.validateSchema) === null || _a === void 0 ? void 0 : _a.call(formCtx, 'validated-only'); }); } // Provide injections vue.provide(FormContextKey, formCtx); return { errors, meta, values: formValues, isSubmitting, submitCount, validate, validateField, handleReset: () => resetForm(), resetForm, handleSubmit, submitForm, setFieldError, setErrors, setFieldValue, setValues, setFieldTouched, setTouched, }; } /** * Manages form meta aggregation */ function useFormMeta(fieldsByPath, currentValues, initialValues, errors) { const MERGE_STRATEGIES = { touched: 'some', pending: 'some', valid: 'every', }; const isDirty = vue.computed(() => { return !es6(currentValues, vue.unref(initialValues)); }); function calculateFlags() { const fields = Object.values(fieldsByPath.value).flat(1).filter(Boolean); return keysOf(MERGE_STRATEGIES).reduce((acc, flag) => { const mergeMethod = MERGE_STRATEGIES[flag]; acc[flag] = fields[mergeMethod](field => field.meta[flag]); return acc; }, {}); } const flags = vue.reactive(calculateFlags()); vue.watchEffect(() => { const value = calculateFlags(); flags.touched = value.touched; flags.valid = value.valid; flags.pending = value.pending; }); return vue.computed(() => { return Object.assign(Object.assign({ initialValues: vue.unref(initialValues) }, flags), { valid: flags.valid && !keysOf(errors.value).length, dirty: isDirty.value }); }); } /** * Manages the initial values prop */ function useFormInitialValues(fields, formValues, providedValues) { // these are the mutable initial values as the fields are mounted/unmounted const initialValues = vue.ref(klona(vue.unref(providedValues)) || {}); // these are the original initial value as provided by the user initially, they don't keep track of conditional fields // this is important because some conditional fields will overwrite the initial values for other fields who had the same name // like array fields, any push/insert operation will overwrite the initial values because they "create new fields" // so these are the values that the reset function should use // these only change when the user explicitly chanegs the initial values or when the user resets them with new values. const originalInitialValues = vue.ref(klona(vue.unref(providedValues)) || {}); function setInitialValues(values, updateFields = false) { initialValues.value = klona(values); originalInitialValues.value = klona(values); if (!updateFields) { return; } // update the pristine non-touched fields // those are excluded because it's unlikely you want to change the form values using initial values // we mostly watch them for API population or newly inserted fields // if the user API is taking too much time before user interaction they should consider disabling or hiding their inputs until the values are ready keysOf(fields.value).forEach(fieldPath => { const field = fields.value[fieldPath]; const wasTouched = Array.isArray(field) ? field.some(f => f.meta.touched) : field === null || field === void 0 ? void 0 : field.meta.touched; if (!field || wasTouched) { return; } const newValue = getFromPath(initialValues.value, fieldPath); setInPath(formValues, fieldPath, klona(newValue)); }); } if (vue.isRef(providedValues)) { vue.watch(providedValues, value => { setInitialValues(value, true); }, { deep: true, }); } return { initialValues, originalInitialValues, setInitialValues, }; } function useErrorBag(initialErrors) { const errorBag = vue.ref({}); function normalizeErrorItem(message) { return Array.isArray(message) ? message : message ? [message] : []; } /** * Manually sets an error message on a specific field */ function setFieldErrorBag(field, message) { if (!message) { delete errorBag.value[field]; return; } errorBag.value[field] = normalizeErrorItem(message); } /** * Sets errors for the fields specified in the object */ function setErrorBag(fields) { errorBag.value = keysOf(fields).reduce((acc, key) => { const message = fields[key]; if (message) { acc[key] = normalizeErrorItem(message); } return acc; }, {}); } if (initialErrors) { setErrorBag(initialErrors); } return { errorBag, setErrorBag, setFieldErrorBag, }; } const FormImpl = vue.defineComponent({ name: 'Form', inheritAttrs: false, props: { as: { type: String, default: 'form', }, validationSchema: { type: Object, default: undefined, }, initialValues: { type: Object, default: undefined, }, initialErrors: { type: Object, default: undefined, }, initialTouched: { type: Object, default: undefined, }, validateOnMount: { type: Boolean, default: false, }, onSubmit: { type: Function, default: undefined, }, onInvalidSubmit: { type: Function, default: undefined, }, }, setup(props, ctx) { const initialValues = vue.toRef(props, 'initialValues'); const validationSchema = vue.toRef(props, 'validationSchema'); const { errors, values, meta, isSubmitting, submitCount, validate, validateField, handleReset, resetForm, handleSubmit, submitForm, setErrors, setFieldError, setFieldValue, setValues, setFieldTouched, setTouched, } = useForm({ validationSchema: validationSchema.value ? validationSchema : undefined, initialValues, initialErrors: props.initialErrors, initialTouched: props.initialTouched, validateOnMount: props.validateOnMount, }); const onSubmit = props.onSubmit ? handleSubmit(props.onSubmit, props.onInvalidSubmit) : submitForm; function handleFormReset(e) { if (isEvent(e)) { // Prevent default form reset behavior e.preventDefault(); } handleReset(); if (typeof ctx.attrs.onReset === 'function') { ctx.attrs.onReset(); } } function handleScopedSlotSubmit(evt, onSubmit) { const onSuccess = typeof evt === 'function' && !onSubmit ? evt : onSubmit; return handleSubmit(onSuccess, props.onInvalidSubmit)(evt); } function slotProps() { return { meta: meta.value, errors: errors.value, values: values, isSubmitting: isSubmitting.value, submitCount: submitCount.value, validate, validateField, handleSubmit: handleScopedSlotSubmit, handleReset, submitForm, setErrors, setFieldError, setFieldValue, setValues, setFieldTouched, setTouched, resetForm, }; } // expose these functions and methods as part of public API ctx.expose({ setFieldError, setErrors, setFieldValue, setValues, setFieldTouched, setTouched, resetForm, validate, validateField, }); return function renderForm() { // avoid resolving the form component as itself const tag = props.as === 'form' ? props.as : vue.resolveDynamicComponent(props.as); const children = normalizeChildren(tag, ctx, slotProps); if (!props.as) { return children; } // Attributes to add on a native `form` tag const formAttrs = props.as === 'form' ? { // Disables native validation as vee-validate will handle it. novalidate: true, } : {}; return vue.h(tag, Object.assign(Object.assign(Object.assign({}, formAttrs), ctx.attrs), { onSubmit, onReset: handleFormReset }), children); }; }, }); const Form = FormImpl; let FIELD_ARRAY_COUNTER = 0; function useFieldArray(arrayPath) { const id = FIELD_ARRAY_COUNTER++; const form = injectWithSelf(FormContextKey, undefined); const fields = vue.ref([]); // eslint-disable-next-line @typescript-eslint/no-empty-function const noOp = () => { }; const noOpApi = { fields: vue.readonly(fields), remove: noOp, push: noOp, swap: noOp, insert: noOp, update: noOp, replace: noOp, prepend: noOp, }; if (!form) { warn('FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly'); return noOpApi; } if (!vue.unref(arrayPath)) { warn('FieldArray requires a field path to be provided, did you forget to pass the `name` prop?'); return noOpApi; } let entryCounter = 0; function initFields() { const currentValues = getFromPath(form === null || form === void 0 ? void 0 : form.values, vue.unref(arrayPath), []); fields.value = currentValues.map(createEntry); updateEntryFlags(); } initFields(); function updateEntryFlags() { const fieldsLength = fields.value.length; for (let i = 0; i < fieldsLength; i++) { const entry = fields.value[i]; entry.isFirst = i === 0; entry.isLast = i === fieldsLength - 1; } } function createEntry(value) { const key = entryCounter++; const entry = { key, value: vue.computed(() => { const currentValues = getFromPath(form === null || form === void 0 ? void 0 : form.values, vue.unref(arrayPath), []); const idx = fields.value.findIndex(e => e.key === key); return idx === -1 ? value : currentValues[idx]; }), isFirst: false, isLast: false, }; return entry; } function remove(idx) { const pathName = vue.unref(arrayPath); const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName); if (!pathValue || !Array.isArray(pathValue)) { return; } const newValue = [...pathValue]; newValue.splice(idx, 1); form === null || form === void 0 ? void 0 : form.unsetInitialValue(pathName + `[${idx}]`); form === null || form === void 0 ? void 0 : form.setFieldValue(pathName, newValue); fields.value.splice(idx, 1); updateEntryFlags(); } function push(value) { const pathName = vue.unref(arrayPath); const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName); const normalizedPathValue = isNullOrUndefined(pathValue) ? [] : pathValue; if (!Array.isArray(normalizedPathValue)) { return; } const newValue = [...normalizedPathValue]; newValue.push(value); form === null || form === void 0 ? void 0 : form.stageInitialValue(pathName + `[${newValue.length - 1}]`, value); form === null || form === void 0 ? void 0 : form.setFieldValue(pathName, newValue); fields.value.push(createEntry(value)); updateEntryFlags(); } function swap(indexA, indexB) { const pathName = vue.unref(arrayPath); const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName); if (!Array.isArray(pathValue) || !pathValue[indexA] || !pathValue[indexB]) { return; } const newValue = [...pathValue]; const newFields = [...fields.value]; // the old switcheroo const temp = newValue[indexA]; newValue[indexA] = newValue[indexB]; newValue[indexB] = temp; const tempEntry = newFields[indexA]; newFields[indexA] = newFields[indexB]; newFields[indexB] = tempEntry; form === null || form === void 0 ? void 0 : form.setFieldValue(pathName, newValue); fields.value = newFields; updateEntryFlags(); } function insert(idx, value) { const pathName = vue.unref(arrayPath); const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName); if (!Array.isArray(pathValue) || pathValue.length < idx) { return; } const newValue = [...pathValue]; const newFields = [...fields.value]; newValue.splice(idx, 0, value); newFields.splice(idx, 0, createEntry(value)); form === null || form === void 0 ? void 0 : form.setFieldValue(pathName, newValue); fields.value = newFields; updateEntryFlags(); } function replace(arr) { const pathName = vue.unref(arrayPath); form === null || form === void 0 ? void 0 : form.setFieldValue(pathName, arr); initFields(); } function update(idx, value) { const pathName = vue.unref(arrayPath); const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName); if (!Array.isArray(pathValue) || pathValue.length - 1 < idx) { return; } form === null || form === void 0 ? void 0 : form.setFieldValue(`${pathName}[${idx}]`, value); } function prepend(value) { const pathName = vue.unref(arrayPath); const pathValue = getFromPath(form === null || form === void 0 ? void 0 : form.values, pathName); const normalizedPathValue = isNullOrUndefined(pathValue) ? [] : pathValue; if (!Array.isArray(normalizedPathValue)) { return; } const newValue = [value, ...normalizedPathValue]; form === null || form === void 0 ? void 0 : form.stageInitialValue(pathName + `[${newValue.length - 1}]`, value); form === null || form === void 0 ? void 0 : form.setFieldValue(pathName, newValue); fields.value.unshift(createEntry(value)); updateEntryFlags(); } form.fieldArraysLookup[id] = { reset: initFields, }; vue.onBeforeUnmount(() => { delete form.fieldArraysLookup[id]; }); return { fields: vue.readonly(fields), remove, push, swap, insert, update, replace, prepend, }; } const FieldArrayImpl = vue.defineComponent({ name: 'FieldArray', inheritAttrs: false, props: { name: { type: String, required: true, }, }, setup(props, ctx) { const { push, remove, swap, insert, replace, update, prepend, fields } = useFieldArray(vue.toRef(props, 'name')); function slotProps() { return { fields: fields.value, push, remove, swap, insert, update, replace, prepend, }; } ctx.expose({ push, remove, swap, insert, update, replace, prepend, }); return () => { const children = normalizeChildren(undefined, ctx, slotProps); return children; }; }, }); const FieldArray = FieldArrayImpl; const ErrorMessageImpl = vue.defineComponent({ name: 'ErrorMessage', props: { as: { type: String, default: undefined, }, name: { type: String, required: true, }, }, setup(props, ctx) { const form = vue.inject(FormContextKey, undefined); const message = vue.computed(() => { return form === null || form === void 0 ? void 0 : form.errors.value[props.name]; }); function slotProps() { return { message: message.value, }; } return () => { // Renders nothing if there are no messages if (!message.value) { return undefined; } const tag = (props.as ? vue.resolveDynamicComponent(props.as) : props.as); const children = normalizeChildren(tag, ctx, slotProps); const attrs = Object.assign({ role: 'alert' }, ctx.attrs); // If no tag was specified and there are children // render the slot as is without wrapping it if (!tag && (Array.isArray(children) || !children) && (children === null || children === void 0 ? void 0 : children.length)) { return children; } // If no children in slot // render whatever specified and fallback to a <span> with the message in it's contents if ((Array.isArray(children) || !children) && !(children === null || children === void 0 ? void 0 : children.length)) { return vue.h(tag || 'span', attrs, message.value); } return vue.h(tag, attrs, children); }; }, }); const ErrorMessage = ErrorMessageImpl; function useResetForm() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return function resetForm(state) { if (!form) { return; } return form.resetForm(state); }; } /** * If a field is dirty or not */ function useIsFieldDirty(path) { const form = injectWithSelf(FormContextKey); let field = path ? undefined : vue.inject(FieldContextKey); return vue.computed(() => { if (path) { field = normalizeField(form === null || form === void 0 ? void 0 : form.fieldsByPath.value[vue.unref(path)]); } if (!field) { warn(`field with name ${vue.unref(path)} was not found`); return false; } return field.meta.dirty; }); } /** * If a field is touched or not */ function useIsFieldTouched(path) { const form = injectWithSelf(FormContextKey); let field = path ? undefined : vue.inject(FieldContextKey); return vue.computed(() => { if (path) { field = normalizeField(form === null || form === void 0 ? void 0 : form.fieldsByPath.value[vue.unref(path)]); } if (!field) { warn(`field with name ${vue.unref(path)} was not found`); return false; } return field.meta.touched; }); } /** * If a field is validated and is valid */ function useIsFieldValid(path) { const form = injectWithSelf(FormContextKey); let field = path ? undefined : vue.inject(FieldContextKey); return vue.computed(() => { if (path) { field = normalizeField(form === null || form === void 0 ? void 0 : form.fieldsByPath.value[vue.unref(path)]); } if (!field) { warn(`field with name ${vue.unref(path)} was not found`); return false; } return field.meta.valid; }); } /** * If the form is submitting or not */ function useIsSubmitting() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return vue.computed(() => { var _a; return (_a = form === null || form === void 0 ? void 0 : form.isSubmitting.value) !== null && _a !== void 0 ? _a : false; }); } /** * Validates a single field */ function useValidateField(path) { const form = injectWithSelf(FormContextKey); let field = path ? undefined : vue.inject(FieldContextKey); return function validateField() { if (path) { field = normalizeField(form === null || form === void 0 ? void 0 : form.fieldsByPath.value[vue.unref(path)]); } if (!field) { warn(`field with name ${vue.unref(path)} was not found`); return Promise.resolve({ errors: [], valid: true, }); } return field.validate(); }; } /** * If the form is dirty or not */ function useIsFormDirty() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return vue.computed(() => { var _a; return (_a = form === null || form === void 0 ? void 0 : form.meta.value.dirty) !== null && _a !== void 0 ? _a : false; }); } /** * If the form is touched or not */ function useIsFormTouched() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return vue.computed(() => { var _a; return (_a = form === null || form === void 0 ? void 0 : form.meta.value.touched) !== null && _a !== void 0 ? _a : false; }); } /** * If the form has been validated and is valid */ function useIsFormValid() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return vue.computed(() => { var _a; return (_a = form === null || form === void 0 ? void 0 : form.meta.value.valid) !== null && _a !== void 0 ? _a : false; }); } /** * Validate multiple fields */ function useValidateForm() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return function validateField() { if (!form) { return Promise.resolve({ results: {}, errors: {}, valid: true }); } return form.validate(); }; } /** * The number of form's submission count */ function useSubmitCount() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return vue.computed(() => { var _a; return (_a = form === null || form === void 0 ? void 0 : form.submitCount.value) !== null && _a !== void 0 ? _a : 0; }); } /** * Gives access to a field's current value */ function useFieldValue(path) { const form = injectWithSelf(FormContextKey); // We don't want to use self injected context as it doesn't make sense const field = path ? undefined : vue.inject(FieldContextKey); return vue.computed(() => { if (path) { return getFromPath(form === null || form === void 0 ? void 0 : form.values, vue.unref(path)); } return vue.unref(field === null || field === void 0 ? void 0 : field.value); }); } /** * Gives access to a form's values */ function useFormValues() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return vue.computed(() => { return (form === null || form === void 0 ? void 0 : form.values) || {}; }); } /** * Gives access to all form errors */ function useFormErrors() { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } return vue.computed(() => { return ((form === null || form === void 0 ? void 0 : form.errors.value) || {}); }); } /** * Gives access to a single field error */ function useFieldError(path) { const form = injectWithSelf(FormContextKey); // We don't want to use self injected context as it doesn't make sense const field = path ? undefined : vue.inject(FieldContextKey); return vue.computed(() => { if (path) { return form === null || form === void 0 ? void 0 : form.errors.value[vue.unref(path)]; } return field === null || field === void 0 ? void 0 : field.errorMessage.value; }); } function useSubmitForm(cb) { const form = injectWithSelf(FormContextKey); if (!form) { warn('No vee-validate <Form /> or `useForm` was detected in the component tree'); } const onSubmit = form ? form.handleSubmit(cb) : undefined; return function submitForm(e) { if (!onSubmit) { return; } return onSubmit(e); }; } exports.ErrorMessage = ErrorMessage; exports.Field = Field; exports.FieldArray = FieldArray; exports.FieldContextKey = FieldContextKey; exports.Form = Form; exports.FormContextKey = FormContextKey; exports.configure = configure; exports.defineRule = defineRule; exports.useField = useField; exports.useFieldArray = useFieldArray; exports.useFieldError = useFieldError; exports.useFieldValue = useFieldValue; exports.useForm = useForm; exports.useFormErrors = useFormErrors; exports.useFormValues = useFormValues; exports.useIsFieldDirty = useIsFieldDirty; exports.useIsFieldTouched = useIsFieldTouched; exports.useIsFieldValid = useIsFieldValid; exports.useIsFormDirty = useIsFormDirty; exports.useIsFormTouched = useIsFormTouched; exports.useIsFormValid = useIsFormValid; exports.useIsSubmitting = useIsSubmitting; exports.useResetForm = useResetForm; exports.useSubmitCount = useSubmitCount; exports.useSubmitForm = useSubmitForm; exports.useValidateField = useValidateField; exports.useValidateForm = useValidateForm; exports.validate = validate; Object.defineProperty(exports, '__esModule', { value: true }); }));
/* Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.add("iframedialog",{requires:"dialog",onLoad:function(){CKEDITOR.dialog.addIframe=function(e,d,a,l,f,n,g){a={type:"iframe",src:a,width:"100%",height:"100%"};a.onContentLoad="function"==typeof n?n:function(){var a=this.getElement().$.contentWindow;if(a.onDialogEvent){var b=this.getDialog(),c=function(b){return a.onDialogEvent(b)};b.on("ok",c);b.on("cancel",c);b.on("resize",c);b.on("hide",function(a){b.removeListener("ok",c);b.removeListener("cancel",c);b.removeListener("resize",c); a.removeListener()});a.onDialogEvent({name:"load",sender:this,editor:b._.editor})}};var h={title:d,minWidth:l,minHeight:f,contents:[{id:"iframe",label:d,expand:!0,elements:[a],style:"width:"+a.width+";height:"+a.height}]},k;for(k in g)h[k]=g[k];this.add(e,function(){return h})};(function(){var e=function(d,a,l){if(!(3>arguments.length)){var f=this._||(this._={}),e=a.onContentLoad&&CKEDITOR.tools.bind(a.onContentLoad,this),g=CKEDITOR.tools.cssLength(a.width),h=CKEDITOR.tools.cssLength(a.height);f.frameId= CKEDITOR.tools.getNextId()+"_iframe";d.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().setStyles({width:g,height:h})});var k={src:"%2",id:f.frameId,frameborder:0,allowtransparency:!0},m=[];"function"==typeof a.onContentLoad&&(k.onload="CKEDITOR.tools.callFunction(%1);");CKEDITOR.ui.dialog.uiElement.call(this,d,a,m,"iframe",{width:g,height:h},k,"");l.push('\x3cdiv style\x3d"width:'+g+";height:"+h+';" id\x3d"'+this.domId+'"\x3e\x3c/div\x3e');m=m.join("");d.on("show",function(){var b= CKEDITOR.document.getById(f.frameId).getParent(),c=CKEDITOR.tools.addFunction(e),c=m.replace("%1",c).replace("%2",CKEDITOR.tools.htmlEncode(a.src));b.setHtml(c)})}};e.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.dialog.addUIElement("iframe",{build:function(d,a,l){return new e(d,a,l)}})})()}});
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _jsxRuntime = require("../../lib/jsxRuntime"); var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var React = _interopRequireWildcard(require("react")); var _icons = require("@vkontakte/icons"); var _Button = _interopRequireDefault(require("../Button/Button")); var _SimpleCell = _interopRequireDefault(require("../SimpleCell/SimpleCell")); var _Avatar = _interopRequireDefault(require("../Avatar/Avatar")); var _Caption = _interopRequireDefault(require("../Typography/Caption/Caption")); var _usePlatform = require("../../hooks/usePlatform"); var _getClassName = require("../../helpers/getClassName"); var _excluded = ["bannerData", "onClose"]; var PromoBanner = function PromoBanner(props) { var platform = (0, _usePlatform.usePlatform)(); var _props$bannerData = props.bannerData, bannerData = _props$bannerData === void 0 ? {} : _props$bannerData, onClose = props.onClose, restProps = (0, _objectWithoutProperties2.default)(props, _excluded); var ageRestrictions = bannerData.ageRestrictions != null ? parseInt(bannerData.ageRestrictions) : bannerData.ageRestriction; var _React$useState = React.useState(""), _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), currentPixel = _React$useState2[0], setCurrentPixel = _React$useState2[1]; var statsPixels = React.useMemo(function () { return bannerData.statistics ? bannerData.statistics.reduce(function (acc, item) { return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, acc), {}, (0, _defineProperty2.default)({}, item.type, item.url)); }, {}) : {}; }, [bannerData.statistics]); var onClick = React.useCallback(function () { return setCurrentPixel(statsPixels.click || ""); }, [statsPixels.click]); React.useEffect(function () { if (statsPixels.playbackStarted) { setCurrentPixel(statsPixels.playbackStarted); } }, [statsPixels.playbackStarted]); return (0, _jsxRuntime.createScopedElement)("div", (0, _extends2.default)({ vkuiClass: (0, _getClassName.getClassName)("PromoBanner", platform) }, restProps), (0, _jsxRuntime.createScopedElement)("div", { vkuiClass: "PromoBanner__head" }, (0, _jsxRuntime.createScopedElement)(_Caption.default, { weight: "regular", level: "1", vkuiClass: "PromoBanner__label" }, bannerData.advertisingLabel || "Advertisement"), ageRestrictions != null && (0, _jsxRuntime.createScopedElement)(_Caption.default, { weight: "regular", level: "1", vkuiClass: "PromoBanner__age" }, ageRestrictions, "+"), !props.isCloseButtonHidden && (0, _jsxRuntime.createScopedElement)("div", { vkuiClass: "PromoBanner__close", onClick: props.onClose }, (0, _jsxRuntime.createScopedElement)(_icons.Icon24Dismiss, null))), (0, _jsxRuntime.createScopedElement)(_SimpleCell.default, { href: bannerData.trackingLink, onClick: onClick, rel: "nofollow noopener noreferrer", target: "_blank", before: (0, _jsxRuntime.createScopedElement)(_Avatar.default, { mode: "image", size: 48, src: bannerData.iconLink, alt: bannerData.title }), after: (0, _jsxRuntime.createScopedElement)(_Button.default, { mode: "outline" }, bannerData.ctaText), description: bannerData.domain }, bannerData.title), currentPixel.length > 0 && (0, _jsxRuntime.createScopedElement)("div", { vkuiClass: "PromoBanner__pixels" }, (0, _jsxRuntime.createScopedElement)("img", { src: currentPixel, alt: "" }))); }; var _default = PromoBanner; exports.default = _default; //# sourceMappingURL=PromoBanner.js.map
CKEDITOR.plugins.setLang("iframe","sr-latn",{border:"Prikaži granicu okvira",noUrl:"Unesite iframe URL",scrolling:"Uključi pomerajuće trake",title:"IFrame podešavanje",toolbar:"IFrame",tabindex:"Remove from tabindex"});
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.TableHead = exports.tableHeadFactory = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactCssThemr = require('react-css-themr'); var _identifiers = require('../identifiers'); var _Checkbox = require('../checkbox/Checkbox'); var _Checkbox2 = _interopRequireDefault(_Checkbox); var _TableCell = require('./TableCell'); var _TableCell2 = _interopRequireDefault(_TableCell); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var factory = function factory(Checkbox, TableCell) { var TableHead = function (_Component) { _inherits(TableHead, _Component); function TableHead() { var _ref; var _temp, _this, _ret; _classCallCheck(this, TableHead); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TableHead.__proto__ || Object.getPrototypeOf(TableHead)).call.apply(_ref, [this].concat(args))), _this), _this.handleSelect = function (value, event) { _this.props.onSelect(value, event); }, _temp), _possibleConstructorReturn(_this, _ret); } _createClass(TableHead, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, displaySelect = _props.displaySelect, multiSelectable = _props.multiSelectable, onSelect = _props.onSelect, selectable = _props.selectable, selected = _props.selected, theme = _props.theme, other = _objectWithoutProperties(_props, ['children', 'displaySelect', 'multiSelectable', 'onSelect', 'selectable', 'selected', 'theme']); return _react2.default.createElement( 'tr', other, selectable && _react2.default.createElement( TableCell, { className: theme.checkboxCell, tagName: 'th' }, displaySelect && _react2.default.createElement(Checkbox, { checked: selected, disabled: !multiSelectable, onChange: this.handleSelect }) ), _react2.default.Children.map(children, function (child, index) { if (!child) return null; return (0, _react.cloneElement)(child, { column: index, tagName: 'th' }); }) ); } }]); return TableHead; }(_react.Component); TableHead.propTypes = { children: _react.PropTypes.node, className: _react.PropTypes.string, displaySelect: _react.PropTypes.bool, multiSelectable: _react.PropTypes.bool, onSelect: _react.PropTypes.func, selectable: _react.PropTypes.bool, selected: _react.PropTypes.bool, theme: _react.PropTypes.shape({ checkboxCell: _react.PropTypes.string }) }; TableHead.defaultProps = { displaySelect: true }; return TableHead; }; var TableHead = factory(_Checkbox2.default, _TableCell2.default); exports.default = (0, _reactCssThemr.themr)(_identifiers.TABLE)(TableHead); exports.tableHeadFactory = factory; exports.TableHead = TableHead;
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.7.1 (2021-03-17) */ (function () { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var __assign = function () { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var noop = function () { }; var constant = function (value) { return function () { return value; }; }; var never = constant(false); var always = constant(true); var none = function () { return NONE; }; var NONE = function () { var eq = function (o) { return o.isNone(); }; var call = function (thunk) { return thunk(); }; var id = function (n) { return n; }; var me = { fold: function (n, _s) { return n(); }, is: never, isSome: never, isNone: always, getOr: id, getOrThunk: call, getOrDie: function (msg) { throw new Error(msg || 'error: getOrDie called on none.'); }, getOrNull: constant(null), getOrUndefined: constant(undefined), or: id, orThunk: call, map: none, each: noop, bind: none, exists: never, forall: always, filter: none, equals: eq, equals_: eq, toArray: function () { return []; }, toString: constant('none()') }; return me; }(); var some = function (a) { var constant_a = constant(a); var self = function () { return me; }; var bind = function (f) { return f(a); }; var me = { fold: function (n, s) { return s(a); }, is: function (v) { return a === v; }, isSome: always, isNone: never, getOr: constant_a, getOrThunk: constant_a, getOrDie: constant_a, getOrNull: constant_a, getOrUndefined: constant_a, or: self, orThunk: self, map: function (f) { return some(f(a)); }, each: function (f) { f(a); }, bind: bind, exists: bind, forall: bind, filter: function (f) { return f(a) ? me : NONE; }, toArray: function () { return [a]; }, toString: function () { return 'some(' + a + ')'; }, equals: function (o) { return o.is(a); }, equals_: function (o, elementEq) { return o.fold(never, function (b) { return elementEq(a, b); }); } }; return me; }; var from = function (value) { return value === null || value === undefined ? NONE : some(value); }; var Optional = { some: some, none: none, from: from }; var typeOf = function (x) { var t = typeof x; if (x === null) { return 'null'; } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { return 'array'; } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { return 'string'; } else { return t; } }; var isType = function (type) { return function (value) { return typeOf(value) === type; }; }; var isString = isType('string'); var isObject = isType('object'); var isArray = isType('array'); var isNullable = function (a) { return a === null || a === undefined; }; var isNonNullable = function (a) { return !isNullable(a); }; var nativePush = Array.prototype.push; var each = function (xs, f) { for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; f(x, i); } }; var flatten = function (xs) { var r = []; for (var i = 0, len = xs.length; i < len; ++i) { if (!isArray(xs[i])) { throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } nativePush.apply(r, xs[i]); } return r; }; var Cell = function (initial) { var value = initial; var get = function () { return value; }; var set = function (v) { value = v; }; return { get: get, set: set }; }; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var each$1 = function (obj, f) { var props = keys(obj); for (var k = 0, len = props.length; k < len; k++) { var i = props[k]; var x = obj[i]; f(x, i); } }; var get = function (obj, key) { return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); }; var has = function (obj, key) { return hasOwnProperty.call(obj, key); }; var getScripts = function (editor) { return editor.getParam('media_scripts'); }; var getAudioTemplateCallback = function (editor) { return editor.getParam('audio_template_callback'); }; var getVideoTemplateCallback = function (editor) { return editor.getParam('video_template_callback'); }; var hasLiveEmbeds = function (editor) { return editor.getParam('media_live_embeds', true); }; var shouldFilterHtml = function (editor) { return editor.getParam('media_filter_html', true); }; var getUrlResolver = function (editor) { return editor.getParam('media_url_resolver'); }; var hasAltSource = function (editor) { return editor.getParam('media_alt_source', true); }; var hasPoster = function (editor) { return editor.getParam('media_poster', true); }; var hasDimensions = function (editor) { return editor.getParam('media_dimensions', true); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); var global$3 = tinymce.util.Tools.resolve('tinymce.html.SaxParser'); var getVideoScriptMatch = function (prefixes, src) { if (prefixes) { for (var i = 0; i < prefixes.length; i++) { if (src.indexOf(prefixes[i].filter) !== -1) { return prefixes[i]; } } } }; var DOM = global$2.DOM; var trimPx = function (value) { return value.replace(/px$/, ''); }; var getEphoxEmbedData = function (attrs) { var style = attrs.map.style; var styles = style ? DOM.parseStyle(style) : {}; return { type: 'ephox-embed-iri', source: attrs.map['data-ephox-embed-iri'], altsource: '', poster: '', width: get(styles, 'max-width').map(trimPx).getOr(''), height: get(styles, 'max-height').map(trimPx).getOr('') }; }; var htmlToData = function (prefixes, html) { var isEphoxEmbed = Cell(false); var data = {}; global$3({ validate: false, allow_conditional_comments: true, start: function (name, attrs) { if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) { isEphoxEmbed.set(true); data = getEphoxEmbedData(attrs); } else { if (!data.source && name === 'param') { data.source = attrs.map.movie; } if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') { if (!data.type) { data.type = name; } data = global$1.extend(attrs.map, data); } if (name === 'script') { var videoScript = getVideoScriptMatch(prefixes, attrs.map.src); if (!videoScript) { return; } data = { type: 'script', source: attrs.map.src, width: String(videoScript.width), height: String(videoScript.height) }; } if (name === 'source') { if (!data.source) { data.source = attrs.map.src; } else if (!data.altsource) { data.altsource = attrs.map.src; } } if (name === 'img' && !data.poster) { data.poster = attrs.map.src; } } } }).parse(html); data.source = data.source || data.src || data.data; data.altsource = data.altsource || ''; data.poster = data.poster || ''; return data; }; var guess = function (url) { var mimes = { mp3: 'audio/mpeg', m4a: 'audio/x-m4a', wav: 'audio/wav', mp4: 'video/mp4', webm: 'video/webm', ogg: 'video/ogg', swf: 'application/x-shockwave-flash' }; var fileEnd = url.toLowerCase().split('.').pop(); var mime = mimes[fileEnd]; return mime ? mime : ''; }; var global$4 = tinymce.util.Tools.resolve('tinymce.html.Schema'); var global$5 = tinymce.util.Tools.resolve('tinymce.html.Writer'); var DOM$1 = global$2.DOM; var addPx = function (value) { return /^[0-9.]+$/.test(value) ? value + 'px' : value; }; var setAttributes = function (attrs, updatedAttrs) { each$1(updatedAttrs, function (val, name) { var value = '' + val; if (attrs.map[name]) { var i = attrs.length; while (i--) { var attr = attrs[i]; if (attr.name === name) { if (value) { attrs.map[name] = value; attr.value = value; } else { delete attrs.map[name]; attrs.splice(i, 1); } } } } else if (value) { attrs.push({ name: name, value: value }); attrs.map[name] = value; } }); }; var updateEphoxEmbed = function (data, attrs) { var style = attrs.map.style; var styleMap = style ? DOM$1.parseStyle(style) : {}; styleMap['max-width'] = addPx(data.width); styleMap['max-height'] = addPx(data.height); setAttributes(attrs, { style: DOM$1.serializeStyle(styleMap) }); }; var sources = [ 'source', 'altsource' ]; var updateHtml = function (html, data, updateAll) { var writer = global$5(); var isEphoxEmbed = Cell(false); var sourceCount = 0; var hasImage; global$3({ validate: false, allow_conditional_comments: true, comment: function (text) { writer.comment(text); }, cdata: function (text) { writer.cdata(text); }, text: function (text, raw) { writer.text(text, raw); }, start: function (name, attrs, empty) { if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) { isEphoxEmbed.set(true); updateEphoxEmbed(data, attrs); } else { switch (name) { case 'video': case 'object': case 'embed': case 'img': case 'iframe': if (data.height !== undefined && data.width !== undefined) { setAttributes(attrs, { width: data.width, height: data.height }); } break; } if (updateAll) { switch (name) { case 'video': setAttributes(attrs, { poster: data.poster, src: '' }); if (data.altsource) { setAttributes(attrs, { src: '' }); } break; case 'iframe': setAttributes(attrs, { src: data.source }); break; case 'source': if (sourceCount < 2) { setAttributes(attrs, { src: data[sources[sourceCount]], type: data[sources[sourceCount] + 'mime'] }); if (!data[sources[sourceCount]]) { return; } } sourceCount++; break; case 'img': if (!data.poster) { return; } hasImage = true; break; } } } writer.start(name, attrs, empty); }, end: function (name) { if (!isEphoxEmbed.get()) { if (name === 'video' && updateAll) { for (var index = 0; index < 2; index++) { if (data[sources[index]]) { var attrs = []; attrs.map = {}; if (sourceCount <= index) { setAttributes(attrs, { src: data[sources[index]], type: data[sources[index] + 'mime'] }); writer.start('source', attrs, true); } } } } if (data.poster && name === 'object' && updateAll && !hasImage) { var imgAttrs = []; imgAttrs.map = {}; setAttributes(imgAttrs, { src: data.poster, width: data.width, height: data.height }); writer.start('img', imgAttrs, true); } } writer.end(name); } }, global$4({})).parse(html); return writer.getContent(); }; var urlPatterns = [ { regex: /youtu\.be\/([\w\-_\?&=.]+)/i, type: 'iframe', w: 560, h: 314, url: 'www.youtube.com/embed/$1', allowFullscreen: true }, { regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i, type: 'iframe', w: 560, h: 314, url: 'www.youtube.com/embed/$2?$4', allowFullscreen: true }, { regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i, type: 'iframe', w: 560, h: 314, url: 'www.youtube.com/embed/$1', allowFullscreen: true }, { regex: /vimeo\.com\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: 'player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', allowFullscreen: true }, { regex: /vimeo\.com\/(.*)\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: 'player.vimeo.com/video/$2?title=0&amp;byline=0', allowFullscreen: true }, { regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: 'maps.google.com/maps/ms?msid=$2&output=embed"', allowFullscreen: false }, { regex: /dailymotion\.com\/video\/([^_]+)/, type: 'iframe', w: 480, h: 270, url: 'www.dailymotion.com/embed/video/$1', allowFullscreen: true }, { regex: /dai\.ly\/([^_]+)/, type: 'iframe', w: 480, h: 270, url: 'www.dailymotion.com/embed/video/$1', allowFullscreen: true } ]; var getProtocol = function (url) { var protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i); if (protocolMatches && protocolMatches.length > 1) { return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1]; } else { return 'https://'; } }; var getUrl = function (pattern, url) { var protocol = getProtocol(url); var match = pattern.regex.exec(url); var newUrl = protocol + pattern.url; var _loop_1 = function (i) { newUrl = newUrl.replace('$' + i, function () { return match[i] ? match[i] : ''; }); }; for (var i = 0; i < match.length; i++) { _loop_1(i); } return newUrl.replace(/\?$/, ''); }; var matchPattern = function (url) { var patterns = urlPatterns.filter(function (pattern) { return pattern.regex.test(url); }); if (patterns.length > 0) { return global$1.extend({}, patterns[0], { url: getUrl(patterns[0], url) }); } else { return null; } }; var getIframeHtml = function (data) { var allowFullscreen = data.allowfullscreen ? ' allowFullscreen="1"' : ''; return '<iframe src="' + data.source + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>'; }; var getFlashHtml = function (data) { var html = '<object data="' + data.source + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">'; if (data.poster) { html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />'; } html += '</object>'; return html; }; var getAudioHtml = function (data, audioTemplateCallback) { if (audioTemplateCallback) { return audioTemplateCallback(data); } else { return '<audio controls="controls" src="' + data.source + '">' + (data.altsource ? '\n<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</audio>'; } }; var getVideoHtml = function (data, videoTemplateCallback) { if (videoTemplateCallback) { return videoTemplateCallback(data); } else { return '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source + '"' + (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' + (data.altsource ? '<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</video>'; } }; var getScriptHtml = function (data) { return '<script src="' + data.source + '"></script>'; }; var dataToHtml = function (editor, dataIn) { var data = global$1.extend({}, dataIn); if (!data.source) { global$1.extend(data, htmlToData(getScripts(editor), data.embed)); if (!data.source) { return ''; } } if (!data.altsource) { data.altsource = ''; } if (!data.poster) { data.poster = ''; } data.source = editor.convertURL(data.source, 'source'); data.altsource = editor.convertURL(data.altsource, 'source'); data.sourcemime = guess(data.source); data.altsourcemime = guess(data.altsource); data.poster = editor.convertURL(data.poster, 'poster'); var pattern = matchPattern(data.source); if (pattern) { data.source = pattern.url; data.type = pattern.type; data.allowfullscreen = pattern.allowFullscreen; data.width = data.width || String(pattern.w); data.height = data.height || String(pattern.h); } if (data.embed) { return updateHtml(data.embed, data, true); } else { var videoScript = getVideoScriptMatch(getScripts(editor), data.source); if (videoScript) { data.type = 'script'; data.width = String(videoScript.width); data.height = String(videoScript.height); } var audioTemplateCallback = getAudioTemplateCallback(editor); var videoTemplateCallback = getVideoTemplateCallback(editor); data.width = data.width || '300'; data.height = data.height || '150'; global$1.each(data, function (value, key) { data[key] = editor.dom.encode('' + value); }); if (data.type === 'iframe') { return getIframeHtml(data); } else if (data.sourcemime === 'application/x-shockwave-flash') { return getFlashHtml(data); } else if (data.sourcemime.indexOf('audio') !== -1) { return getAudioHtml(data, audioTemplateCallback); } else if (data.type === 'script') { return getScriptHtml(data); } else { return getVideoHtml(data, videoTemplateCallback); } } }; var global$6 = tinymce.util.Tools.resolve('tinymce.util.Promise'); var cache = {}; var embedPromise = function (data, dataToHtml, handler) { return new global$6(function (res, rej) { var wrappedResolve = function (response) { if (response.html) { cache[data.source] = response; } return res({ url: data.source, html: response.html ? response.html : dataToHtml(data) }); }; if (cache[data.source]) { wrappedResolve(cache[data.source]); } else { handler({ url: data.source }, wrappedResolve, rej); } }); }; var defaultPromise = function (data, dataToHtml) { return new global$6(function (res) { res({ html: dataToHtml(data), url: data.source }); }); }; var loadedData = function (editor) { return function (data) { return dataToHtml(editor, data); }; }; var getEmbedHtml = function (editor, data) { var embedHandler = getUrlResolver(editor); return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor)); }; var isCached = function (url) { return cache.hasOwnProperty(url); }; var extractMeta = function (sourceInput, data) { return get(data, sourceInput).bind(function (mainData) { return get(mainData, 'meta'); }); }; var getValue = function (data, metaData, sourceInput) { return function (prop) { var _a; var getFromData = function () { return get(data, prop); }; var getFromMetaData = function () { return get(metaData, prop); }; var getNonEmptyValue = function (c) { return get(c, 'value').bind(function (v) { return v.length > 0 ? Optional.some(v) : Optional.none(); }); }; var getFromValueFirst = function () { return getFromData().bind(function (child) { return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () { return Optional.from(child); }); }); }; var getFromMetaFirst = function () { return getFromMetaData().orThunk(function () { return getFromData().bind(function (child) { return isObject(child) ? getNonEmptyValue(child) : Optional.from(child); }); }); }; return _a = {}, _a[prop] = (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr(''), _a; }; }; var getDimensions = function (data, metaData) { var dimensions = {}; get(data, 'dimensions').each(function (dims) { each([ 'width', 'height' ], function (prop) { get(metaData, prop).orThunk(function () { return get(dims, prop); }).each(function (value) { return dimensions[prop] = value; }); }); }); return dimensions; }; var unwrap = function (data, sourceInput) { var metaData = sourceInput ? extractMeta(sourceInput, data).getOr({}) : {}; var get = getValue(data, metaData, sourceInput); return __assign(__assign(__assign(__assign(__assign({}, get('source')), get('altsource')), get('poster')), get('embed')), getDimensions(data, metaData)); }; var wrap = function (data) { var wrapped = __assign(__assign({}, data), { source: { value: get(data, 'source').getOr('') }, altsource: { value: get(data, 'altsource').getOr('') }, poster: { value: get(data, 'poster').getOr('') } }); each([ 'width', 'height' ], function (prop) { get(data, prop).each(function (value) { var dimensions = wrapped.dimensions || {}; dimensions[prop] = value; wrapped.dimensions = dimensions; }); }); return wrapped; }; var handleError = function (editor) { return function (error) { var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.'; editor.notificationManager.open({ type: 'error', text: errorMessage }); }; }; var snippetToData = function (editor, embedSnippet) { return htmlToData(getScripts(editor), embedSnippet); }; var isMediaElement = function (element) { return element.getAttribute('data-mce-object') || element.getAttribute('data-ephox-embed-iri'); }; var getEditorData = function (editor) { var element = editor.selection.getNode(); var snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : ''; return __assign({ embed: snippet }, htmlToData(getScripts(editor), snippet)); }; var addEmbedHtml = function (api, editor) { return function (response) { if (isString(response.url) && response.url.trim().length > 0) { var html = response.html; var snippetData = snippetToData(editor, html); var nuData = __assign(__assign({}, snippetData), { source: response.url, embed: html }); api.setData(wrap(nuData)); } }; }; var selectPlaceholder = function (editor, beforeObjects) { var afterObjects = editor.dom.select('*[data-mce-object]'); for (var i = 0; i < beforeObjects.length; i++) { for (var y = afterObjects.length - 1; y >= 0; y--) { if (beforeObjects[i] === afterObjects[y]) { afterObjects.splice(y, 1); } } } editor.selection.select(afterObjects[0]); }; var handleInsert = function (editor, html) { var beforeObjects = editor.dom.select('*[data-mce-object]'); editor.insertContent(html); selectPlaceholder(editor, beforeObjects); editor.nodeChanged(); }; var submitForm = function (prevData, newData, editor) { newData.embed = updateHtml(newData.embed, newData); if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) { handleInsert(editor, newData.embed); } else { getEmbedHtml(editor, newData).then(function (response) { handleInsert(editor, response.html); }).catch(handleError(editor)); } }; var showDialog = function (editor) { var editorData = getEditorData(editor); var currentData = Cell(editorData); var initialData = wrap(editorData); var handleSource = function (prevData, api) { var serviceData = unwrap(api.getData(), 'source'); if (prevData.source !== serviceData.source) { addEmbedHtml(win, editor)({ url: serviceData.source, html: '' }); getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor)); } }; var handleEmbed = function (api) { var data = unwrap(api.getData()); var dataFromEmbed = snippetToData(editor, data.embed); api.setData(wrap(dataFromEmbed)); }; var handleUpdate = function (api, sourceInput) { var data = unwrap(api.getData(), sourceInput); var embed = dataToHtml(editor, data); api.setData(wrap(__assign(__assign({}, data), { embed: embed }))); }; var mediaInput = [{ name: 'source', type: 'urlinput', filetype: 'media', label: 'Source' }]; var sizeInput = !hasDimensions(editor) ? [] : [{ type: 'sizeinput', name: 'dimensions', label: 'Constrain proportions', constrain: true }]; var generalTab = { title: 'General', name: 'general', items: flatten([ mediaInput, sizeInput ]) }; var embedTextarea = { type: 'textarea', name: 'embed', label: 'Paste your embed code below:' }; var embedTab = { title: 'Embed', items: [embedTextarea] }; var advancedFormItems = []; if (hasAltSource(editor)) { advancedFormItems.push({ name: 'altsource', type: 'urlinput', filetype: 'media', label: 'Alternative source URL' }); } if (hasPoster(editor)) { advancedFormItems.push({ name: 'poster', type: 'urlinput', filetype: 'image', label: 'Media poster (Image URL)' }); } var advancedTab = { title: 'Advanced', name: 'advanced', items: advancedFormItems }; var tabs = [ generalTab, embedTab ]; if (advancedFormItems.length > 0) { tabs.push(advancedTab); } var body = { type: 'tabpanel', tabs: tabs }; var win = editor.windowManager.open({ title: 'Insert/Edit Media', size: 'normal', body: body, buttons: [ { type: 'cancel', name: 'cancel', text: 'Cancel' }, { type: 'submit', name: 'save', text: 'Save', primary: true } ], onSubmit: function (api) { var serviceData = unwrap(api.getData()); submitForm(currentData.get(), serviceData, editor); api.close(); }, onChange: function (api, detail) { switch (detail.name) { case 'source': handleSource(currentData.get(), api); break; case 'embed': handleEmbed(api); break; case 'dimensions': case 'altsource': case 'poster': handleUpdate(api, detail.name); break; } currentData.set(unwrap(api.getData())); }, initialData: initialData }); }; var get$1 = function (editor) { var showDialog$1 = function () { showDialog(editor); }; return { showDialog: showDialog$1 }; }; var register = function (editor) { var showDialog$1 = function () { showDialog(editor); }; editor.addCommand('mceMedia', showDialog$1); }; var global$7 = tinymce.util.Tools.resolve('tinymce.html.Node'); var global$8 = tinymce.util.Tools.resolve('tinymce.Env'); var global$9 = tinymce.util.Tools.resolve('tinymce.html.DomParser'); var sanitize = function (editor, html) { if (shouldFilterHtml(editor) === false) { return html; } var writer = global$5(); var blocked; global$3({ validate: false, allow_conditional_comments: false, comment: function (text) { if (!blocked) { writer.comment(text); } }, cdata: function (text) { if (!blocked) { writer.cdata(text); } }, text: function (text, raw) { if (!blocked) { writer.text(text, raw); } }, start: function (name, attrs, empty) { blocked = true; if (name === 'script' || name === 'noscript' || name === 'svg') { return; } for (var i = attrs.length - 1; i >= 0; i--) { var attrName = attrs[i].name; if (attrName.indexOf('on') === 0) { delete attrs.map[attrName]; attrs.splice(i, 1); } if (attrName === 'style') { attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name); } } writer.start(name, attrs, empty); blocked = false; }, end: function (name) { if (blocked) { return; } writer.end(name); } }, global$4({})).parse(html); return writer.getContent(); }; var isLiveEmbedNode = function (node) { var name = node.name; return name === 'iframe' || name === 'video' || name === 'audio'; }; var getDimension = function (node, styles, dimension, defaultValue) { if (defaultValue === void 0) { defaultValue = null; } var value = node.attr(dimension); if (isNonNullable(value)) { return value; } else if (!has(styles, dimension)) { return defaultValue; } else { return null; } }; var setDimensions = function (node, previewNode, styles) { var useDefaults = previewNode.name === 'img' || node.name === 'video'; var defaultWidth = useDefaults ? '300' : null; var fallbackHeight = node.name === 'audio' ? '30' : '150'; var defaultHeight = useDefaults ? fallbackHeight : null; previewNode.attr({ width: getDimension(node, styles, 'width', defaultWidth), height: getDimension(node, styles, 'height', defaultHeight) }); }; var appendNodeContent = function (editor, nodeName, previewNode, html) { var newNode = global$9({ forced_root_block: false, validate: false }, editor.schema).parse(html, { context: nodeName }); while (newNode.firstChild) { previewNode.append(newNode.firstChild); } }; var createPlaceholderNode = function (editor, node) { var name = node.name; var placeHolder = new global$7('img', 1); placeHolder.shortEnded = true; retainAttributesAndInnerHtml(editor, node, placeHolder); setDimensions(node, placeHolder, {}); placeHolder.attr({ 'style': node.attr('style'), 'src': global$8.transparentSrc, 'data-mce-object': name, 'class': 'mce-object mce-object-' + name }); return placeHolder; }; var createPreviewNode = function (editor, node) { var name = node.name; var previewWrapper = new global$7('span', 1); previewWrapper.attr({ 'contentEditable': 'false', 'style': node.attr('style'), 'data-mce-object': name, 'class': 'mce-preview-object mce-object-' + name }); retainAttributesAndInnerHtml(editor, node, previewWrapper); var styles = editor.dom.parseStyle(node.attr('style')); var previewNode = new global$7(name, 1); setDimensions(node, previewNode, styles); previewNode.attr({ src: node.attr('src'), style: node.attr('style'), class: node.attr('class') }); if (name === 'iframe') { previewNode.attr({ allowfullscreen: node.attr('allowfullscreen'), frameborder: '0' }); } else { var attrs = [ 'controls', 'crossorigin', 'currentTime', 'loop', 'muted', 'poster', 'preload' ]; each(attrs, function (attrName) { previewNode.attr(attrName, node.attr(attrName)); }); var sanitizedHtml = previewWrapper.attr('data-mce-html'); if (isNonNullable(sanitizedHtml)) { appendNodeContent(editor, name, previewNode, sanitizedHtml); } } var shimNode = new global$7('span', 1); shimNode.attr('class', 'mce-shim'); previewWrapper.append(previewNode); previewWrapper.append(shimNode); return previewWrapper; }; var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) { var attribs = sourceNode.attributes; var ai = attribs.length; while (ai--) { var attrName = attribs[ai].name; var attrValue = attribs[ai].value; if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') { if (attrName === 'data' || attrName === 'src') { attrValue = editor.convertURL(attrValue, attrName); } targetNode.attr('data-mce-p-' + attrName, attrValue); } } var innerHtml = sourceNode.firstChild && sourceNode.firstChild.value; if (innerHtml) { targetNode.attr('data-mce-html', escape(sanitize(editor, innerHtml))); targetNode.firstChild = null; } }; var isPageEmbedWrapper = function (node) { var nodeClass = node.attr('class'); return nodeClass && /\btiny-pageembed\b/.test(nodeClass); }; var isWithinEmbedWrapper = function (node) { while (node = node.parent) { if (node.attr('data-ephox-embed-iri') || isPageEmbedWrapper(node)) { return true; } } return false; }; var placeHolderConverter = function (editor) { return function (nodes) { var i = nodes.length; var node; var videoScript; while (i--) { node = nodes[i]; if (!node.parent) { continue; } if (node.parent.attr('data-mce-object')) { continue; } if (node.name === 'script') { videoScript = getVideoScriptMatch(getScripts(editor), node.attr('src')); if (!videoScript) { continue; } } if (videoScript) { if (videoScript.width) { node.attr('width', videoScript.width.toString()); } if (videoScript.height) { node.attr('height', videoScript.height.toString()); } } if (isLiveEmbedNode(node) && hasLiveEmbeds(editor) && global$8.ceFalse) { if (!isWithinEmbedWrapper(node)) { node.replace(createPreviewNode(editor, node)); } } else { if (!isWithinEmbedWrapper(node)) { node.replace(createPlaceholderNode(editor, node)); } } } }; }; var setup = function (editor) { editor.on('preInit', function () { var specialElements = editor.schema.getSpecialElements(); global$1.each('video audio iframe object'.split(' '), function (name) { specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi'); }); var boolAttrs = editor.schema.getBoolAttrs(); global$1.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) { boolAttrs[name] = {}; }); editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', placeHolderConverter(editor)); editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) { var i = nodes.length; var node; var realElm; var ai; var attribs; var innerHtml; var innerNode; var realElmName; var className; while (i--) { node = nodes[i]; if (!node.parent) { continue; } realElmName = node.attr(name); realElm = new global$7(realElmName, 1); if (realElmName !== 'audio' && realElmName !== 'script') { className = node.attr('class'); if (className && className.indexOf('mce-preview-object') !== -1) { realElm.attr({ width: node.firstChild.attr('width'), height: node.firstChild.attr('height') }); } else { realElm.attr({ width: node.attr('width'), height: node.attr('height') }); } } realElm.attr({ style: node.attr('style') }); attribs = node.attributes; ai = attribs.length; while (ai--) { var attrName = attribs[ai].name; if (attrName.indexOf('data-mce-p-') === 0) { realElm.attr(attrName.substr(11), attribs[ai].value); } } if (realElmName === 'script') { realElm.attr('type', 'text/javascript'); } innerHtml = node.attr('data-mce-html'); if (innerHtml) { innerNode = new global$7('#text', 3); innerNode.raw = true; innerNode.value = sanitize(editor, unescape(innerHtml)); realElm.append(innerNode); } node.replace(realElm); } }); }); editor.on('SetContent', function () { editor.$('span.mce-preview-object').each(function (index, elm) { var $elm = editor.$(elm); if ($elm.find('span.mce-shim').length === 0) { $elm.append('<span class="mce-shim"></span>'); } }); }); }; var setup$1 = function (editor) { editor.on('ResolveName', function (e) { var name; if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) { e.name = name; } }); }; var setup$2 = function (editor) { editor.on('click keyup touchend', function () { var selectedNode = editor.selection.getNode(); if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) { if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) { selectedNode.setAttribute('data-mce-selected', '2'); } } }); editor.on('ObjectSelected', function (e) { var objectType = e.target.getAttribute('data-mce-object'); if (objectType === 'script') { e.preventDefault(); } }); editor.on('ObjectResized', function (e) { var target = e.target; var html; if (target.getAttribute('data-mce-object')) { html = target.getAttribute('data-mce-html'); if (html) { html = unescape(html); target.setAttribute('data-mce-html', escape(updateHtml(html, { width: String(e.width), height: String(e.height) }))); } } }); }; var stateSelectorAdapter = function (editor, selector) { return function (buttonApi) { return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind; }; }; var register$1 = function (editor) { editor.ui.registry.addToggleButton('media', { tooltip: 'Insert/edit media', icon: 'embed', onAction: function () { editor.execCommand('mceMedia'); }, onSetup: stateSelectorAdapter(editor, [ 'img[data-mce-object]', 'span[data-mce-object]', 'div[data-ephox-embed-iri]' ]) }); editor.ui.registry.addMenuItem('media', { icon: 'embed', text: 'Media...', onAction: function () { editor.execCommand('mceMedia'); } }); }; function Plugin () { global.add('media', function (editor) { register(editor); register$1(editor); setup$1(editor); setup(editor); setup$2(editor); return get$1(editor); }); } Plugin(); }());
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.6.2 (2020-12-08) */ (function () { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); var getAutoLinkPattern = function (editor) { return editor.getParam('autolink_pattern', /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i); }; var getDefaultLinkTarget = function (editor) { return editor.getParam('default_link_target', false); }; var getDefaultLinkProtocol = function (editor) { return editor.getParam('link_default_protocol', 'http', 'string'); }; var rangeEqualsDelimiterOrSpace = function (rangeString, delimiter) { return rangeString === delimiter || rangeString === ' ' || rangeString.charCodeAt(0) === 160; }; var handleEclipse = function (editor) { parseCurrentLine(editor, -1, '('); }; var handleSpacebar = function (editor) { parseCurrentLine(editor, 0, ''); }; var handleEnter = function (editor) { parseCurrentLine(editor, -1, ''); }; var scopeIndex = function (container, index) { if (index < 0) { index = 0; } if (container.nodeType === 3) { var len = container.data.length; if (index > len) { index = len; } } return index; }; var setStart = function (rng, container, offset) { if (container.nodeType !== 1 || container.hasChildNodes()) { rng.setStart(container, scopeIndex(container, offset)); } else { rng.setStartBefore(container); } }; var setEnd = function (rng, container, offset) { if (container.nodeType !== 1 || container.hasChildNodes()) { rng.setEnd(container, scopeIndex(container, offset)); } else { rng.setEndAfter(container); } }; var parseCurrentLine = function (editor, endOffset, delimiter) { var end, endContainer, bookmark, text, prev, len, rngText; var autoLinkPattern = getAutoLinkPattern(editor); var defaultLinkTarget = getDefaultLinkTarget(editor); if (editor.selection.getNode().tagName === 'A') { return; } var rng = editor.selection.getRng().cloneRange(); if (rng.startOffset < 5) { prev = rng.endContainer.previousSibling; if (!prev) { if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) { return; } prev = rng.endContainer.firstChild.nextSibling; } len = prev.length; setStart(rng, prev, len); setEnd(rng, prev, len); if (rng.endOffset < 5) { return; } end = rng.endOffset; endContainer = prev; } else { endContainer = rng.endContainer; if (endContainer.nodeType !== 3 && endContainer.firstChild) { while (endContainer.nodeType !== 3 && endContainer.firstChild) { endContainer = endContainer.firstChild; } if (endContainer.nodeType === 3) { setStart(rng, endContainer, 0); setEnd(rng, endContainer, endContainer.nodeValue.length); } } if (rng.endOffset === 1) { end = 2; } else { end = rng.endOffset - 1 - endOffset; } } var start = end; do { setStart(rng, endContainer, end >= 2 ? end - 2 : 0); setEnd(rng, endContainer, end >= 1 ? end - 1 : 0); end -= 1; rngText = rng.toString(); } while (rngText !== ' ' && rngText !== '' && rngText.charCodeAt(0) !== 160 && end - 2 >= 0 && rngText !== delimiter); if (rangeEqualsDelimiterOrSpace(rng.toString(), delimiter)) { setStart(rng, endContainer, end); setEnd(rng, endContainer, start); end += 1; } else if (rng.startOffset === 0) { setStart(rng, endContainer, 0); setEnd(rng, endContainer, start); } else { setStart(rng, endContainer, end); setEnd(rng, endContainer, start); } text = rng.toString(); if (text.charAt(text.length - 1) === '.') { setEnd(rng, endContainer, start - 1); } text = rng.toString().trim(); var matches = text.match(autoLinkPattern); var protocol = getDefaultLinkProtocol(editor); if (matches) { if (matches[1] === 'www.') { matches[1] = protocol + '://www.'; } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { matches[1] = 'mailto:' + matches[1]; } bookmark = editor.selection.getBookmark(); editor.selection.setRng(rng); editor.execCommand('createlink', false, matches[1] + matches[2]); if (defaultLinkTarget !== false) { editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget); } editor.selection.moveToBookmark(bookmark); editor.nodeChanged(); } }; var setup = function (editor) { var autoUrlDetectState; editor.on('keydown', function (e) { if (e.keyCode === 13) { return handleEnter(editor); } }); if (global$1.browser.isIE()) { editor.on('focus', function () { if (!autoUrlDetectState) { autoUrlDetectState = true; try { editor.execCommand('AutoUrlDetect', false, true); } catch (ex) { } } }); return; } editor.on('keypress', function (e) { if (e.keyCode === 41) { return handleEclipse(editor); } }); editor.on('keyup', function (e) { if (e.keyCode === 32) { return handleSpacebar(editor); } }); }; function Plugin () { global.add('autolink', function (editor) { setup(editor); }); } Plugin(); }());
/* Highstock JS v8.1.0 (2020-05-05) (c) 2009-2018 Torstein Honsi License: www.highcharts.com/license */ (function(S,P){"object"===typeof module&&module.exports?(P["default"]=P,module.exports=S.document?P(S):P):"function"===typeof define&&define.amd?define("highcharts/highstock",function(){return P(S)}):(S.Highcharts&&S.Highcharts.error(16,!0),S.Highcharts=P(S))})("undefined"!==typeof window?window:this,function(S){function P(k,g,H,v){k.hasOwnProperty(g)||(k[g]=v.apply(null,H))}var A={};P(A,"parts/Globals.js",[],function(){var k="undefined"!==typeof S?S:"undefined"!==typeof window?window:{},g=k.document, H=k.navigator&&k.navigator.userAgent||"",v=g&&g.createElementNS&&!!g.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,K=/(edge|msie|trident)/i.test(H)&&!k.opera,G=-1!==H.indexOf("Firefox"),N=-1!==H.indexOf("Chrome"),M=G&&4>parseInt(H.split("Firefox/")[1],10);return{product:"Highcharts",version:"8.1.0",deg2rad:2*Math.PI/360,doc:g,hasBidiBug:M,hasTouch:!!k.TouchEvent,isMS:K,isWebKit:-1!==H.indexOf("AppleWebKit"),isFirefox:G,isChrome:N,isSafari:!N&&-1!==H.indexOf("Safari"),isTouchDevice:/(Mobile|Android|Windows Phone)/.test(H), SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:v,win:k,marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){},charts:[],dateFormats:{}}});P(A,"parts/Utilities.js",[A["parts/Globals.js"]],function(k){function g(){var b,d=arguments,n={},x=function(b,d){"object"!==typeof b&&(b={});T(d,function(n,a){!H(n,!0)||q(n)||t(n)?b[a]=d[a]:b[a]=x(b[a]||{},n)});return b};!0===d[0]&&(n=d[1],d=Array.prototype.slice.call(d,2));var a=d.length;for(b=0;b< a;b++)n=x(n,d[b]);return n}function H(b,d){return!!b&&"object"===typeof b&&(!d||!z(b))}function v(b,d,n){var x;D(d)?f(n)?b.setAttribute(d,n):b&&b.getAttribute&&((x=b.getAttribute(d))||"class"!==d||(x=b.getAttribute(d+"Name"))):T(d,function(d,n){b.setAttribute(n,d)});return x}function K(){for(var b=arguments,d=b.length,n=0;n<d;n++){var x=b[n];if("undefined"!==typeof x&&null!==x)return x}}function G(b,d){if(!b)return d;var n=b.split(".").reverse();if(1===n.length)return d[b];for(b=n.pop();"undefined"!== typeof b&&"undefined"!==typeof d&&null!==d;)d=d[b],b=n.pop();return d}k.timers=[];var N=k.charts,M=k.doc,y=k.win,I=k.error=function(b,d,n,x){var a=r(b),c=a?"Highcharts error #"+b+": www.highcharts.com/errors/"+b+"/":b.toString(),e=function(){if(d)throw Error(c);y.console&&console.log(c)};if("undefined"!==typeof x){var f="";a&&(c+="?");T(x,function(b,d){f+="\n"+d+": "+b;a&&(c+=encodeURI(d)+"="+encodeURI(b))});c+=f}n?Z(n,"displayError",{code:b,message:c,params:x},e):e()},J=function(){function b(b,d, n){this.options=d;this.elem=b;this.prop=n}b.prototype.dSetter=function(){var b=this.paths,d=b&&b[0];b=b&&b[1];var n=[],x=this.now||0;if(1!==x&&d&&b)if(d.length===b.length&&1>x)for(var a=0;a<b.length;a++){for(var c=d[a],e=b[a],f=[],m=0;m<e.length;m++){var u=c[m],p=e[m];f[m]="number"===typeof u&&"number"===typeof p&&("A"!==e[0]||4!==m&&5!==m)?u+x*(p-u):p}n.push(f)}else n=b;else n=this.toD||[];this.elem.attr("d",n,void 0,!0)};b.prototype.update=function(){var b=this.elem,d=this.prop,n=this.now,x=this.options.step; if(this[d+"Setter"])this[d+"Setter"]();else b.attr?b.element&&b.attr(d,n,null,!0):b.style[d]=n+this.unit;x&&x.call(b,n,this)};b.prototype.run=function(b,d,n){var x=this,a=x.options,c=function(b){return c.stopped?!1:x.step(b)},e=y.requestAnimationFrame||function(b){setTimeout(b,13)},f=function(){for(var b=0;b<k.timers.length;b++)k.timers[b]()||k.timers.splice(b--,1);k.timers.length&&e(f)};b!==d||this.elem["forceAnimate:"+this.prop]?(this.startTime=+new Date,this.start=b,this.end=d,this.unit=n,this.now= this.start,this.pos=0,c.elem=this.elem,c.prop=this.prop,c()&&1===k.timers.push(c)&&e(f)):(delete a.curAnim[this.prop],a.complete&&0===Object.keys(a.curAnim).length&&a.complete.call(this.elem))};b.prototype.step=function(b){var d=+new Date,n=this.options,x=this.elem,a=n.complete,c=n.duration,e=n.curAnim;if(x.attr&&!x.element)b=!1;else if(b||d>=c+this.startTime){this.now=this.end;this.pos=1;this.update();var f=e[this.prop]=!0;T(e,function(b){!0!==b&&(f=!1)});f&&a&&a.call(x);b=!1}else this.pos=n.easing((d- this.startTime)/c),this.now=this.start+(this.end-this.start)*this.pos,this.update(),b=!0;return b};b.prototype.initPath=function(b,d,n){function x(b,d){for(;b.length<h;){var n=b[0],x=d[h-b.length];x&&"M"===n[0]&&(b[0]="C"===x[0]?["C",n[1],n[2],n[1],n[2],n[1],n[2]]:["L",n[1],n[2]]);b.unshift(n);f&&b.push(b[b.length-1])}}function a(b,d){for(;b.length<h;)if(d=b[b.length/m-1].slice(),"C"===d[0]&&(d[1]=d[5],d[2]=d[6]),f){var n=b[b.length/m].slice();b.splice(b.length/2,0,d,n)}else b.push(d)}var c=b.startX, e=b.endX;d=d&&d.slice();n=n.slice();var f=b.isArea,m=f?2:1;if(!d)return[n,n];if(c&&e){for(b=0;b<c.length;b++)if(c[b]===e[0]){var u=b;break}else if(c[0]===e[e.length-c.length+b]){u=b;var p=!0;break}else if(c[c.length-1]===e[e.length-c.length+b]){u=c.length-b;break}"undefined"===typeof u&&(d=[])}if(d.length&&r(u)){var h=n.length+u*m;p?(x(d,n),a(n,d)):(x(n,d),a(d,n))}return[d,n]};b.prototype.fillSetter=function(){b.prototype.strokeSetter.apply(this,arguments)};b.prototype.strokeSetter=function(){this.elem.attr(this.prop, k.color(this.start).tweenTo(k.color(this.end),this.pos),null,!0)};return b}();k.Fx=J;k.merge=g;var E=k.pInt=function(b,d){return parseInt(b,d||10)},D=k.isString=function(b){return"string"===typeof b},z=k.isArray=function(b){b=Object.prototype.toString.call(b);return"[object Array]"===b||"[object Array Iterator]"===b};k.isObject=H;var t=k.isDOMElement=function(b){return H(b)&&"number"===typeof b.nodeType},q=k.isClass=function(b){var d=b&&b.constructor;return!(!H(b,!0)||t(b)||!d||!d.name||"Object"=== d.name)},r=k.isNumber=function(b){return"number"===typeof b&&!isNaN(b)&&Infinity>b&&-Infinity<b},h=k.erase=function(b,d){for(var n=b.length;n--;)if(b[n]===d){b.splice(n,1);break}},f=k.defined=function(b){return"undefined"!==typeof b&&null!==b};k.attr=v;var a=k.splat=function(b){return z(b)?b:[b]},l=k.syncTimeout=function(b,d,n){if(0<d)return setTimeout(b,d,n);b.call(0,n);return-1},e=k.clearTimeout=function(b){f(b)&&clearTimeout(b)},c=k.extend=function(b,d){var n;b||(b={});for(n in d)b[n]=d[n];return b}; k.pick=K;var m=k.css=function(b,d){k.isMS&&!k.svg&&d&&"undefined"!==typeof d.opacity&&(d.filter="alpha(opacity="+100*d.opacity+")");c(b.style,d)},u=k.createElement=function(b,d,n,x,a){b=M.createElement(b);d&&c(b,d);a&&m(b,{padding:"0",border:"none",margin:"0"});n&&m(b,n);x&&x.appendChild(b);return b},L=k.extendClass=function(b,d){var n=function(){};n.prototype=new b;c(n.prototype,d);return n},F=k.pad=function(b,d,n){return Array((d||2)+1-String(b).replace("-","").length).join(n||"0")+b},w=k.relativeLength= function(b,d,n){return/%$/.test(b)?d*parseFloat(b)/100+(n||0):parseFloat(b)},p=k.wrap=function(b,d,n){var x=b[d];b[d]=function(){var b=Array.prototype.slice.call(arguments),d=arguments,a=this;a.proceed=function(){x.apply(a,arguments.length?arguments:d)};b.unshift(x);b=n.apply(this,b);a.proceed=null;return b}},C=k.format=function(b,d,n){var x="{",a=!1,c=[],e=/f$/,f=/\.([0-9])/,m=k.defaultOptions.lang,u=n&&n.time||k.time;for(n=n&&n.numberFormatter||W;b;){var p=b.indexOf(x);if(-1===p)break;var h=b.slice(0, p);if(a){h=h.split(":");x=G(h.shift()||"",d);if(h.length&&"number"===typeof x)if(h=h.join(":"),e.test(h)){var Q=parseInt((h.match(f)||["","-1"])[1],10);null!==x&&(x=n(x,Q,m.decimalPoint,-1<h.indexOf(",")?m.thousandsSep:""))}else x=u.dateFormat(h,x);c.push(x)}else c.push(h);b=b.slice(p+1);x=(a=!a)?"}":"{"}c.push(b);return c.join("")},O=k.getMagnitude=function(b){return Math.pow(10,Math.floor(Math.log(b)/Math.LN10))},B=k.normalizeTickInterval=function(b,d,n,x,a){var c=b;n=K(n,1);var e=b/n;d||(d=a?[1, 1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===x&&(1===n?d=d.filter(function(b){return 0===b%1}):.1>=n&&(d=[1/n])));for(x=0;x<d.length&&!(c=d[x],a&&c*n>=b||!a&&e<=(d[x]+(d[x+1]||d[x]))/2);x++);return c=R(c*n,-Math.round(Math.log(.001)/Math.LN10))},d=k.stableSort=function(b,d){var n=b.length,x,a;for(a=0;a<n;a++)b[a].safeI=a;b.sort(function(b,n){x=d(b,n);return 0===x?b.safeI-n.safeI:x});for(a=0;a<n;a++)delete b[a].safeI},b=k.arrayMin=function(b){for(var d=b.length,n=b[0];d--;)b[d]<n&&(n=b[d]);return n}, n=k.arrayMax=function(b){for(var d=b.length,n=b[0];d--;)b[d]>n&&(n=b[d]);return n},x=k.destroyObjectProperties=function(b,d){T(b,function(n,x){n&&n!==d&&n.destroy&&n.destroy();delete b[x]})},Q=k.discardElement=function(b){var d=k.garbageBin;d||(d=u("div"));b&&d.appendChild(b);d.innerHTML=""},R=k.correctFloat=function(b,d){return parseFloat(b.toPrecision(d||14))},X=k.setAnimation=function(b,d){d.renderer.globalAnimation=K(b,d.options.chart.animation,!0)},U=k.animObject=function(b){return H(b)?g(b): {duration:b?500:0}},V=k.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5},W=k.numberFormat=function(b,d,n,x){b=+b||0;d=+d;var a=k.defaultOptions.lang,c=(b.toString().split(".")[1]||"").split("e")[0].length,e=b.toString().split("e");if(-1===d)d=Math.min(c,20);else if(!r(d))d=2;else if(d&&e[1]&&0>e[1]){var f=d+ +e[1];0<=f?(e[0]=(+e[0]).toExponential(f).split("e")[0],d=f):(e[0]=e[0].split(".")[0]||0,b=20>d?(e[0]*Math.pow(10,e[1])).toFixed(d): 0,e[1]=0)}var m=(Math.abs(e[1]?e[0]:b)+Math.pow(10,-Math.max(d,c)-1)).toFixed(d);c=String(E(m));f=3<c.length?c.length%3:0;n=K(n,a.decimalPoint);x=K(x,a.thousandsSep);b=(0>b?"-":"")+(f?c.substr(0,f)+x:"");b+=c.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+x);d&&(b+=n+m.slice(-d));e[1]&&0!==+b&&(b+="e"+e[1]);return b};Math.easeInOutSine=function(b){return-.5*(Math.cos(Math.PI*b)-1)};var aa=k.getStyle=function(b,d,n){if("width"===d)return d=Math.min(b.offsetWidth,b.scrollWidth),n=b.getBoundingClientRect&& b.getBoundingClientRect().width,n<d&&n>=d-1&&(d=Math.floor(n)),Math.max(0,d-k.getStyle(b,"padding-left")-k.getStyle(b,"padding-right"));if("height"===d)return Math.max(0,Math.min(b.offsetHeight,b.scrollHeight)-k.getStyle(b,"padding-top")-k.getStyle(b,"padding-bottom"));y.getComputedStyle||I(27,!0);if(b=y.getComputedStyle(b,void 0))b=b.getPropertyValue(d),K(n,"opacity"!==d)&&(b=E(b));return b},Y=k.inArray=function(b,d,n){return d.indexOf(b,n)},fa=k.find=Array.prototype.find?function(b,d){return b.find(d)}: function(b,d){var n,x=b.length;for(n=0;n<x;n++)if(d(b[n],n))return b[n]};k.keys=Object.keys;var ba=k.offset=function(b){var d=M.documentElement;b=b.parentElement||b.parentNode?b.getBoundingClientRect():{top:0,left:0};return{top:b.top+(y.pageYOffset||d.scrollTop)-(d.clientTop||0),left:b.left+(y.pageXOffset||d.scrollLeft)-(d.clientLeft||0)}},ca=k.stop=function(b,d){for(var n=k.timers.length;n--;)k.timers[n].elem!==b||d&&d!==k.timers[n].prop||(k.timers[n].stopped=!0)},T=k.objectEach=function(b,d,n){for(var x in b)Object.hasOwnProperty.call(b, x)&&d.call(n||b[x],b[x],x,b)};T({map:"map",each:"forEach",grep:"filter",reduce:"reduce",some:"some"},function(b,d){k[d]=function(d){return Array.prototype[b].apply(d,[].slice.call(arguments,1))}});var ha=k.addEvent=function(b,d,n,x){void 0===x&&(x={});var a=b.addEventListener||k.addEventListenerPolyfill;var c="function"===typeof b&&b.prototype?b.prototype.protoEvents=b.prototype.protoEvents||{}:b.hcEvents=b.hcEvents||{};k.Point&&b instanceof k.Point&&b.series&&b.series.chart&&(b.series.chart.runTrackerClick= !0);a&&a.call(b,d,n,!1);c[d]||(c[d]=[]);c[d].push({fn:n,order:"number"===typeof x.order?x.order:Infinity});c[d].sort(function(b,d){return b.order-d.order});return function(){A(b,d,n)}},A=k.removeEvent=function(b,d,n){function x(d,n){var x=b.removeEventListener||k.removeEventListenerPolyfill;x&&x.call(b,d,n,!1)}function a(n){var a;if(b.nodeName){if(d){var c={};c[d]=!0}else c=n;T(c,function(b,d){if(n[d])for(a=n[d].length;a--;)x(d,n[d][a].fn)})}}var c;["protoEvents","hcEvents"].forEach(function(e,f){var m= (f=f?b:b.prototype)&&f[e];m&&(d?(c=m[d]||[],n?(m[d]=c.filter(function(b){return n!==b.fn}),x(d,n)):(a(m),m[d]=[])):(a(m),f[e]={}))})},Z=k.fireEvent=function(b,d,n,x){var a;n=n||{};if(M.createEvent&&(b.dispatchEvent||b.fireEvent)){var e=M.createEvent("Events");e.initEvent(d,!0,!0);c(e,n);b.dispatchEvent?b.dispatchEvent(e):b.fireEvent(d,e)}else n.target||c(n,{preventDefault:function(){n.defaultPrevented=!0},target:b,type:d}),function(d,x){void 0===d&&(d=[]);void 0===x&&(x=[]);var c=0,e=0,f=d.length+ x.length;for(a=0;a<f;a++)!1===(d[c]?x[e]?d[c].order<=x[e].order?d[c++]:x[e++]:d[c++]:x[e++]).fn.call(b,n)&&n.preventDefault()}(b.protoEvents&&b.protoEvents[d],b.hcEvents&&b.hcEvents[d]);x&&!n.defaultPrevented&&x.call(b,n)},ia=k.animate=function(b,d,n){var x,a="",c,e;if(!H(n)){var f=arguments;n={duration:f[2],easing:f[3],complete:f[4]}}r(n.duration)||(n.duration=400);n.easing="function"===typeof n.easing?n.easing:Math[n.easing]||Math.easeInOutSine;n.curAnim=g(d);T(d,function(f,m){ca(b,m);e=new J(b, n,m);c=null;"d"===m&&z(d.d)?(e.paths=e.initPath(b,b.pathArray,d.d),e.toD=d.d,x=0,c=1):b.attr?x=b.attr(m):(x=parseFloat(aa(b,m))||0,"opacity"!==m&&(a="px"));c||(c=f);c&&c.match&&c.match("px")&&(c=c.replace(/px/g,""));e.run(x,c,a)})},ja=k.seriesType=function(b,d,n,x,a){var c=k.getOptions(),e=k.seriesTypes;c.plotOptions[b]=g(c.plotOptions[d],n);e[b]=L(e[d]||function(){},x);e[b].prototype.type=b;a&&(e[b].prototype.pointClass=L(k.Point,a));return e[b]},ea=k.uniqueKey=function(){var b=Math.random().toString(36).substring(2, 9),d=0;return function(){return"highcharts-"+b+"-"+d++}}(),P=k.isFunction=function(b){return"function"===typeof b};y.jQuery&&(y.jQuery.fn.highcharts=function(){var b=[].slice.call(arguments);if(this[0])return b[0]?(new (k[D(b[0])?b.shift():"Chart"])(this[0],b[0],b[1]),this):N[v(this[0],"data-highcharts-chart")]});return{Fx:k.Fx,addEvent:ha,animate:ia,animObject:U,arrayMax:n,arrayMin:b,attr:v,clamp:function(b,d,n){return b>d?b<n?b:n:d},clearTimeout:e,correctFloat:R,createElement:u,css:m,defined:f, destroyObjectProperties:x,discardElement:Q,erase:h,error:I,extend:c,extendClass:L,find:fa,fireEvent:Z,format:C,getMagnitude:O,getNestedProperty:G,getStyle:aa,inArray:Y,isArray:z,isClass:q,isDOMElement:t,isFunction:P,isNumber:r,isObject:H,isString:D,merge:g,normalizeTickInterval:B,numberFormat:W,objectEach:T,offset:ba,pad:F,pick:K,pInt:E,relativeLength:w,removeEvent:A,seriesType:ja,setAnimation:X,splat:a,stableSort:d,stop:ca,syncTimeout:l,timeUnits:V,uniqueKey:ea,wrap:p}});P(A,"parts/Color.js",[A["parts/Globals.js"], A["parts/Utilities.js"]],function(k,g){var H=g.isNumber,v=g.merge,K=g.pInt;g=function(){function g(k){this.parsers=[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(g){return[K(g[1]),K(g[2]),K(g[3]),parseFloat(g[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(g){return[K(g[1]),K(g[2]),K(g[3]),1]}}];this.rgba=[];if(!(this instanceof g))return new g(k);this.init(k)}g.parse=function(k){return new g(k)}; g.prototype.init=function(k){var v,y;if((this.input=k=g.names[k&&k.toLowerCase?k.toLowerCase():""]||k)&&k.stops)this.stops=k.stops.map(function(y){return new g(y[1])});else{if(k&&k.charAt&&"#"===k.charAt()){var I=k.length;k=parseInt(k.substr(1),16);7===I?v=[(k&16711680)>>16,(k&65280)>>8,k&255,1]:4===I&&(v=[(k&3840)>>4|(k&3840)>>8,(k&240)>>4|k&240,(k&15)<<4|k&15,1])}if(!v)for(y=this.parsers.length;y--&&!v;){var J=this.parsers[y];(I=J.regex.exec(k))&&(v=J.parse(I))}}this.rgba=v||[]};g.prototype.get= function(k){var g=this.input,y=this.rgba;if("undefined"!==typeof this.stops){var I=v(g);I.stops=[].concat(I.stops);this.stops.forEach(function(y,g){I.stops[g]=[I.stops[g][0],y.get(k)]})}else I=y&&H(y[0])?"rgb"===k||!k&&1===y[3]?"rgb("+y[0]+","+y[1]+","+y[2]+")":"a"===k?y[3]:"rgba("+y.join(",")+")":g;return I};g.prototype.brighten=function(k){var g,y=this.rgba;if(this.stops)this.stops.forEach(function(y){y.brighten(k)});else if(H(k)&&0!==k)for(g=0;3>g;g++)y[g]+=K(255*k),0>y[g]&&(y[g]=0),255<y[g]&& (y[g]=255);return this};g.prototype.setOpacity=function(g){this.rgba[3]=g;return this};g.prototype.tweenTo=function(g,k){var y=this.rgba,v=g.rgba;v.length&&y&&y.length?(g=1!==v[3]||1!==y[3],k=(g?"rgba(":"rgb(")+Math.round(v[0]+(y[0]-v[0])*(1-k))+","+Math.round(v[1]+(y[1]-v[1])*(1-k))+","+Math.round(v[2]+(y[2]-v[2])*(1-k))+(g?","+(v[3]+(y[3]-v[3])*(1-k)):"")+")"):k=g.input||"none";return k};g.names={white:"#ffffff",black:"#000000"};return g}();k.Color=g;k.color=g.parse;return k.Color});P(A,"parts/SVGElement.js", [A["parts/Color.js"],A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g,H){var v=g.deg2rad,K=g.doc,G=g.hasTouch,N=g.isFirefox,M=g.noop,y=g.svg,I=g.SVG_NS,J=g.win,E=H.animate,D=H.animObject,z=H.attr,t=H.createElement,q=H.css,r=H.defined,h=H.erase,f=H.extend,a=H.fireEvent,l=H.inArray,e=H.isArray,c=H.isFunction,m=H.isNumber,u=H.isString,L=H.merge,F=H.objectEach,w=H.pick,p=H.pInt,C=H.stop,O=H.uniqueKey;H=function(){function B(){this.height=this.element=void 0;this.opacity=1;this.renderer=void 0; this.SVG_NS=I;this.symbolCustomAttribs="x y width height r start end innerR anchorX anchorY rounded".split(" ");this.textProps="color cursor direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" ");this.width=void 0}B.prototype._defaultGetter=function(d){d=w(this[d+"Value"],this[d],this.element?this.element.getAttribute(d):null,0);/^[\-0-9\.]+$/.test(d)&&(d=parseFloat(d));return d};B.prototype._defaultSetter=function(d,b,n){n.setAttribute(b, d)};B.prototype.add=function(d){var b=this.renderer,n=this.element;d&&(this.parentGroup=d);this.parentInverted=d&&d.inverted;"undefined"!==typeof this.textStr&&b.buildText(this);this.added=!0;if(!d||d.handleZ||this.zIndex)var x=this.zIndexSetter();x||(d?d.element:b.box).appendChild(n);if(this.onAdd)this.onAdd();return this};B.prototype.addClass=function(d,b){var n=b?"":this.attr("class")||"";d=(d||"").split(/ /g).reduce(function(b,d){-1===n.indexOf(d)&&b.push(d);return b},n?[n]:[]).join(" ");d!== n&&this.attr("class",d);return this};B.prototype.afterSetters=function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)};B.prototype.align=function(d,b,n){var x,a={};var c=this.renderer;var e=c.alignedObjects;var f,m;if(d){if(this.alignOptions=d,this.alignByTranslate=b,!n||u(n))this.alignTo=x=n||"renderer",h(e,this),e.push(this),n=void 0}else d=this.alignOptions,b=this.alignByTranslate,x=this.alignTo;n=w(n,c[x],c);x=d.align;c=d.verticalAlign;e=(n.x||0)+(d.x||0);var p=(n.y||0)+(d.y|| 0);"right"===x?f=1:"center"===x&&(f=2);f&&(e+=(n.width-(d.width||0))/f);a[b?"translateX":"x"]=Math.round(e);"bottom"===c?m=1:"middle"===c&&(m=2);m&&(p+=(n.height-(d.height||0))/m);a[b?"translateY":"y"]=Math.round(p);this[this.placed?"animate":"attr"](a);this.placed=!0;this.alignAttr=a;return this};B.prototype.alignSetter=function(d){var b={left:"start",center:"middle",right:"end"};b[d]&&(this.alignValue=d,this.element.setAttribute("text-anchor",b[d]))};B.prototype.animate=function(d,b,n){var x=D(w(b, this.renderer.globalAnimation,!0));w(K.hidden,K.msHidden,K.webkitHidden,!1)&&(x.duration=0);0!==x.duration?(n&&(x.complete=n),E(this,d,x)):(this.attr(d,void 0,n),F(d,function(b,d){x.step&&x.step.call(this,b,{prop:d,pos:1})},this));return this};B.prototype.applyTextOutline=function(d){var b=this.element,n;-1!==d.indexOf("contrast")&&(d=d.replace(/contrast/g,this.renderer.getContrast(b.style.fill)));d=d.split(" ");var x=d[d.length-1];if((n=d[0])&&"none"!==n&&g.svg){this.fakeTS=!0;d=[].slice.call(b.getElementsByTagName("tspan")); this.ySetter=this.xSetter;n=n.replace(/(^[\d\.]+)(.*?)$/g,function(b,d,n){return 2*d+n});this.removeTextOutline(d);var a=b.textContent?/^[\u0591-\u065F\u066A-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(b.textContent):!1;var c=b.firstChild;d.forEach(function(d,e){0===e&&(d.setAttribute("x",b.getAttribute("x")),e=b.getAttribute("y"),d.setAttribute("y",e||0),null===e&&b.setAttribute("y",0));e=d.cloneNode(!0);z(a&&!N?d:e,{"class":"highcharts-text-outline",fill:x,stroke:x,"stroke-width":n,"stroke-linejoin":"round"}); b.insertBefore(e,c)});a&&N&&d[0]&&(d=d[0].cloneNode(!0),d.textContent=" ",b.insertBefore(d,c))}};B.prototype.attr=function(d,b,n,x){var a=this.element,c,e=this,f,m,u=this.symbolCustomAttribs;if("string"===typeof d&&"undefined"!==typeof b){var p=d;d={};d[p]=b}"string"===typeof d?e=(this[d+"Getter"]||this._defaultGetter).call(this,d,a):(F(d,function(b,n){f=!1;x||C(this,n);this.symbolName&&-1!==l(n,u)&&(c||(this.symbolAttr(d),c=!0),f=!0);!this.rotation||"x"!==n&&"y"!==n||(this.doTransform=!0);f||(m= this[n+"Setter"]||this._defaultSetter,m.call(this,b,n,a),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(n)&&this.updateShadows(n,b,m))},this),this.afterSetters());n&&n.call(this);return e};B.prototype.clip=function(d){return this.attr("clip-path",d?"url("+this.renderer.url+"#"+d.id+")":"none")};B.prototype.crisp=function(d,b){b=b||d.strokeWidth||0;var n=Math.round(b)%2/2;d.x=Math.floor(d.x||this.x||0)+n;d.y=Math.floor(d.y||this.y||0)+n;d.width=Math.floor((d.width|| this.width||0)-2*n);d.height=Math.floor((d.height||this.height||0)-2*n);r(d.strokeWidth)&&(d.strokeWidth=b);return d};B.prototype.complexColor=function(d,b,n){var x=this.renderer,c,f,m,u,p,h,w,l,C,B,t=[],q;a(this.renderer,"complexColor",{args:arguments},function(){d.radialGradient?f="radialGradient":d.linearGradient&&(f="linearGradient");if(f){m=d[f];p=x.gradients;h=d.stops;C=n.radialReference;e(m)&&(d[f]=m={x1:m[0],y1:m[1],x2:m[2],y2:m[3],gradientUnits:"userSpaceOnUse"});"radialGradient"===f&&C&& !r(m.gradientUnits)&&(u=m,m=L(m,x.getRadialAttr(C,u),{gradientUnits:"userSpaceOnUse"}));F(m,function(b,d){"id"!==d&&t.push(d,b)});F(h,function(b){t.push(b)});t=t.join(",");if(p[t])B=p[t].attr("id");else{m.id=B=O();var a=p[t]=x.createElement(f).attr(m).add(x.defs);a.radAttr=u;a.stops=[];h.forEach(function(b){0===b[1].indexOf("rgba")?(c=k.parse(b[1]),w=c.get("rgb"),l=c.get("a")):(w=b[1],l=1);b=x.createElement("stop").attr({offset:b[0],"stop-color":w,"stop-opacity":l}).add(a);a.stops.push(b)})}q="url("+ x.url+"#"+B+")";n.setAttribute(b,q);n.gradient=t;d.toString=function(){return q}}})};B.prototype.css=function(d){var b=this.styles,n={},x=this.element,a="",c=!b,e=["textOutline","textOverflow","width"];d&&d.color&&(d.fill=d.color);b&&F(d,function(d,x){b&&b[x]!==d&&(n[x]=d,c=!0)});if(c){b&&(d=f(b,n));if(d)if(null===d.width||"auto"===d.width)delete this.textWidth;else if("text"===x.nodeName.toLowerCase()&&d.width)var m=this.textWidth=p(d.width);this.styles=d;m&&!y&&this.renderer.forExport&&delete d.width; if(x.namespaceURI===this.SVG_NS){var u=function(b,d){return"-"+d.toLowerCase()};F(d,function(b,d){-1===e.indexOf(d)&&(a+=d.replace(/([A-Z])/g,u)+":"+b+";")});a&&z(x,"style",a)}else q(x,d);this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),d&&d.textOutline&&this.applyTextOutline(d.textOutline))}return this};B.prototype.dashstyleSetter=function(d){var b=this["stroke-width"];"inherit"===b&&(b=1);if(d=d&&d.toLowerCase()){var n=d.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot", "3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(d=n.length;d--;)n[d]=""+p(n[d])*w(b,NaN);d=n.join(",").replace(/NaN/g,"none");this.element.setAttribute("stroke-dasharray",d)}};B.prototype.destroy=function(){var d=this,b=d.element||{},n=d.renderer,x=n.isSVG&&"SPAN"===b.nodeName&&d.parentGroup||void 0,a=b.ownerSVGElement;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point= null;C(d);if(d.clipPath&&a){var c=d.clipPath;[].forEach.call(a.querySelectorAll("[clip-path],[CLIP-PATH]"),function(b){-1<b.getAttribute("clip-path").indexOf(c.element.id)&&b.removeAttribute("clip-path")});d.clipPath=c.destroy()}if(d.stops){for(a=0;a<d.stops.length;a++)d.stops[a].destroy();d.stops.length=0;d.stops=void 0}d.safeRemoveChild(b);for(n.styledMode||d.destroyShadows();x&&x.div&&0===x.div.childNodes.length;)b=x.parentGroup,d.safeRemoveChild(x.div),delete x.div,x=b;d.alignTo&&h(n.alignedObjects, d);F(d,function(b,n){d[n]&&d[n].parentGroup===d&&d[n].destroy&&d[n].destroy();delete d[n]})};B.prototype.destroyShadows=function(){(this.shadows||[]).forEach(function(d){this.safeRemoveChild(d)},this);this.shadows=void 0};B.prototype.destroyTextPath=function(d,b){var n=d.getElementsByTagName("text")[0];if(n){if(n.removeAttribute("dx"),n.removeAttribute("dy"),b.element.setAttribute("id",""),this.textPathWrapper&&n.getElementsByTagName("textPath").length){for(d=this.textPathWrapper.element.childNodes;d.length;)n.appendChild(d[0]); n.removeChild(this.textPathWrapper.element)}}else if(d.getAttribute("dx")||d.getAttribute("dy"))d.removeAttribute("dx"),d.removeAttribute("dy");this.textPathWrapper&&(this.textPathWrapper=this.textPathWrapper.destroy())};B.prototype.dSetter=function(d,b,n){e(d)&&("string"===typeof d[0]&&(d=this.renderer.pathToSegments(d)),this.pathArray=d,d=d.reduce(function(b,d,n){return d&&d.join?(n?b+" ":"")+d.join(" "):(d||"").toString()},""));/(NaN| {2}|^$)/.test(d)&&(d="M 0 0");this[b]!==d&&(n.setAttribute(b, d),this[b]=d)};B.prototype.fadeOut=function(d){var b=this;b.animate({opacity:0},{duration:w(d,150),complete:function(){b.attr({y:-9999}).hide()}})};B.prototype.fillSetter=function(d,b,n){"string"===typeof d?n.setAttribute(b,d):d&&this.complexColor(d,b,n)};B.prototype.getBBox=function(d,b){var n,x=this.renderer,a=this.element,e=this.styles,m=this.textStr,u=x.cache,p=x.cacheKeys,h=a.namespaceURI===this.SVG_NS;b=w(b,this.rotation,0);var l=x.styledMode?a&&B.prototype.getStyle.call(a,"font-size"):e&&e.fontSize; if(r(m)){var C=m.toString();-1===C.indexOf("<")&&(C=C.replace(/[0-9]/g,"0"));C+=["",b,l,this.textWidth,e&&e.textOverflow,e&&e.fontWeight].join()}C&&!d&&(n=u[C]);if(!n){if(h||x.forExport){try{var F=this.fakeTS&&function(b){[].forEach.call(a.querySelectorAll(".highcharts-text-outline"),function(d){d.style.display=b})};c(F)&&F("none");n=a.getBBox?f({},a.getBBox()):{width:a.offsetWidth,height:a.offsetHeight};c(F)&&F("")}catch(ba){""}if(!n||0>n.width)n={width:0,height:0}}else n=this.htmlGetBBox();x.isSVG&& (d=n.width,x=n.height,h&&(n.height=x={"11px,17":14,"13px,20":16}[e&&e.fontSize+","+Math.round(x)]||x),b&&(e=b*v,n.width=Math.abs(x*Math.sin(e))+Math.abs(d*Math.cos(e)),n.height=Math.abs(x*Math.cos(e))+Math.abs(d*Math.sin(e))));if(C&&0<n.height){for(;250<p.length;)delete u[p.shift()];u[C]||p.push(C);u[C]=n}}return n};B.prototype.getStyle=function(d){return J.getComputedStyle(this.element||this,"").getPropertyValue(d)};B.prototype.hasClass=function(d){return-1!==(""+this.attr("class")).split(" ").indexOf(d)}; B.prototype.hide=function(d){d?this.attr({y:-9999}):this.attr({visibility:"hidden"});return this};B.prototype.htmlGetBBox=function(){return{height:0,width:0,x:0,y:0}};B.prototype.init=function(d,b){this.element="span"===b?t(b):K.createElementNS(this.SVG_NS,b);this.renderer=d;a(this,"afterInit")};B.prototype.invert=function(d){this.inverted=d;this.updateTransform();return this};B.prototype.on=function(d,b){var n,x,a=this.element,c;G&&"click"===d?(a.ontouchstart=function(b){n=b.touches[0].clientX;x= b.touches[0].clientY},a.ontouchend=function(d){n&&4<=Math.sqrt(Math.pow(n-d.changedTouches[0].clientX,2)+Math.pow(x-d.changedTouches[0].clientY,2))||b.call(a,d);c=!0;d.preventDefault()},a.onclick=function(d){c||b.call(a,d)}):a["on"+d]=b;return this};B.prototype.opacitySetter=function(d,b,n){this[b]=d;n.setAttribute(b,d)};B.prototype.removeClass=function(d){return this.attr("class",(""+this.attr("class")).replace(u(d)?new RegExp(" ?"+d+" ?"):d,""))};B.prototype.removeTextOutline=function(d){for(var b= d.length,n;b--;)n=d[b],"highcharts-text-outline"===n.getAttribute("class")&&h(d,this.element.removeChild(n))};B.prototype.safeRemoveChild=function(d){var b=d.parentNode;b&&b.removeChild(d)};B.prototype.setRadialReference=function(d){var b=this.element.gradient&&this.renderer.gradients[this.element.gradient];this.element.radialReference=d;b&&b.radAttr&&b.animate(this.renderer.getRadialAttr(d,b.radAttr));return this};B.prototype.setTextPath=function(d,b){var n=this.element,x={textAnchor:"text-anchor"}, a=!1,c=this.textPathWrapper,e=!c;b=L(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},b);var f=b.attributes;if(d&&b&&b.enabled){c&&null===c.element.parentNode?(e=!0,c=c.destroy()):c&&this.removeTextOutline.call(c.parentGroup,[].slice.call(n.getElementsByTagName("tspan")));this.options&&this.options.padding&&(f.dx=-this.options.padding);c||(this.textPathWrapper=c=this.renderer.createElement("textPath"),a=!0);var u=c.element;(b=d.element.getAttribute("id"))||d.element.setAttribute("id", b=O());if(e)for(d=n.getElementsByTagName("tspan");d.length;)d[0].setAttribute("y",0),m(f.dx)&&d[0].setAttribute("x",-f.dx),u.appendChild(d[0]);a&&c&&c.add({element:this.text?this.text.element:n});u.setAttributeNS("http://www.w3.org/1999/xlink","href",this.renderer.url+"#"+b);r(f.dy)&&(u.parentNode.setAttribute("dy",f.dy),delete f.dy);r(f.dx)&&(u.parentNode.setAttribute("dx",f.dx),delete f.dx);F(f,function(b,d){u.setAttribute(x[d]||d,b)});n.removeAttribute("transform");this.removeTextOutline.call(c, [].slice.call(n.getElementsByTagName("tspan")));this.text&&!this.renderer.styledMode&&this.attr({fill:"none","stroke-width":0});this.applyTextOutline=this.updateTransform=M}else c&&(delete this.updateTransform,delete this.applyTextOutline,this.destroyTextPath(n,d),this.updateTransform(),this.options&&this.options.rotation&&this.applyTextOutline(this.options.style.textOutline));return this};B.prototype.shadow=function(d,b,n){var x=[],a=this.element,c=!1,e=this.oldShadowOptions;var m={color:"#000000", offsetX:1,offsetY:1,opacity:.15,width:3};var u;!0===d?u=m:"object"===typeof d&&(u=f(m,d));u&&(u&&e&&F(u,function(b,d){b!==e[d]&&(c=!0)}),c&&this.destroyShadows(),this.oldShadowOptions=u);if(!u)this.destroyShadows();else if(!this.shadows){var p=u.opacity/u.width;var h=this.parentInverted?"translate(-1,-1)":"translate("+u.offsetX+", "+u.offsetY+")";for(m=1;m<=u.width;m++){var w=a.cloneNode(!1);var l=2*u.width+1-2*m;z(w,{stroke:d.color||"#000000","stroke-opacity":p*m,"stroke-width":l,transform:h,fill:"none"}); w.setAttribute("class",(w.getAttribute("class")||"")+" highcharts-shadow");n&&(z(w,"height",Math.max(z(w,"height")-l,0)),w.cutHeight=l);b?b.element.appendChild(w):a.parentNode&&a.parentNode.insertBefore(w,a);x.push(w)}this.shadows=x}return this};B.prototype.show=function(d){return this.attr({visibility:d?"inherit":"visible"})};B.prototype.strokeSetter=function(d,b,n){this[b]=d;this.stroke&&this["stroke-width"]?(B.prototype.fillSetter.call(this,this.stroke,"stroke",n),n.setAttribute("stroke-width", this["stroke-width"]),this.hasStroke=!0):"stroke-width"===b&&0===d&&this.hasStroke?(n.removeAttribute("stroke"),this.hasStroke=!1):this.renderer.styledMode&&this["stroke-width"]&&(n.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0)};B.prototype.strokeWidth=function(){if(!this.renderer.styledMode)return this["stroke-width"]||0;var d=this.getStyle("stroke-width"),b=0;if(d.indexOf("px")===d.length-2)b=p(d);else if(""!==d){var n=K.createElementNS(I,"rect");z(n,{width:d,"stroke-width":0}); this.element.parentNode.appendChild(n);b=n.getBBox().width;n.parentNode.removeChild(n)}return b};B.prototype.symbolAttr=function(d){var b=this;"x y r start end width height innerR anchorX anchorY clockwise".split(" ").forEach(function(n){b[n]=w(d[n],b[n])});b.attr({d:b.renderer.symbols[b.symbolName](b.x,b.y,b.width,b.height,b)})};B.prototype.textSetter=function(d){d!==this.textStr&&(delete this.textPxLength,this.textStr=d,this.added&&this.renderer.buildText(this))};B.prototype.titleSetter=function(d){var b= this.element.getElementsByTagName("title")[0];b||(b=K.createElementNS(this.SVG_NS,"title"),this.element.appendChild(b));b.firstChild&&b.removeChild(b.firstChild);b.appendChild(K.createTextNode(String(w(d,"")).replace(/<[^>]*>/g,"").replace(/&lt;/g,"<").replace(/&gt;/g,">")))};B.prototype.toFront=function(){var d=this.element;d.parentNode.appendChild(d);return this};B.prototype.translate=function(d,b){return this.attr({translateX:d,translateY:b})};B.prototype.updateShadows=function(d,b,n){var x=this.shadows; if(x)for(var a=x.length;a--;)n.call(x[a],"height"===d?Math.max(b-(x[a].cutHeight||0),0):"d"===d?this.d:b,d,x[a])};B.prototype.updateTransform=function(){var d=this.translateX||0,b=this.translateY||0,n=this.scaleX,x=this.scaleY,a=this.inverted,c=this.rotation,e=this.matrix,f=this.element;a&&(d+=this.width,b+=this.height);d=["translate("+d+","+b+")"];r(e)&&d.push("matrix("+e.join(",")+")");a?d.push("rotate(90) scale(-1,1)"):c&&d.push("rotate("+c+" "+w(this.rotationOriginX,f.getAttribute("x"),0)+" "+ w(this.rotationOriginY,f.getAttribute("y")||0)+")");(r(n)||r(x))&&d.push("scale("+w(n,1)+" "+w(x,1)+")");d.length&&f.setAttribute("transform",d.join(" "))};B.prototype.visibilitySetter=function(d,b,n){"inherit"===d?n.removeAttribute(b):this[b]!==d&&n.setAttribute(b,d);this[b]=d};B.prototype.xGetter=function(d){"circle"===this.element.nodeName&&("x"===d?d="cx":"y"===d&&(d="cy"));return this._defaultGetter(d)};B.prototype.zIndexSetter=function(d,b){var n=this.renderer,x=this.parentGroup,a=(x||n).element|| n.box,c=this.element,e=!1;n=a===n.box;var f=this.added;var m;r(d)?(c.setAttribute("data-z-index",d),d=+d,this[b]===d&&(f=!1)):r(this[b])&&c.removeAttribute("data-z-index");this[b]=d;if(f){(d=this.zIndex)&&x&&(x.handleZ=!0);b=a.childNodes;for(m=b.length-1;0<=m&&!e;m--){x=b[m];f=x.getAttribute("data-z-index");var u=!r(f);if(x!==c)if(0>d&&u&&!n&&!m)a.insertBefore(c,b[m]),e=!0;else if(p(f)<=d||u&&(!r(d)||0<=d))a.insertBefore(c,b[m+1]||null),e=!0}e||(a.insertBefore(c,b[n?3:0]||null),e=!0)}return e};return B}(); H.prototype["stroke-widthSetter"]=H.prototype.strokeSetter;H.prototype.yGetter=H.prototype.xGetter;H.prototype.matrixSetter=H.prototype.rotationOriginXSetter=H.prototype.rotationOriginYSetter=H.prototype.rotationSetter=H.prototype.scaleXSetter=H.prototype.scaleYSetter=H.prototype.translateXSetter=H.prototype.translateYSetter=H.prototype.verticalAlignSetter=function(a,d){this[d]=a;this.doTransform=!0};g.SVGElement=H;return g.SVGElement});P(A,"parts/SvgRenderer.js",[A["parts/Color.js"],A["parts/Globals.js"], A["parts/SVGElement.js"],A["parts/Utilities.js"]],function(k,g,H,v){var K=k.parse,G=v.addEvent,N=v.attr,M=v.createElement,y=v.css,I=v.defined,J=v.destroyObjectProperties,E=v.extend,D=v.isArray,z=v.isNumber,t=v.isObject,q=v.isString,r=v.merge,h=v.objectEach,f=v.pick,a=v.pInt,l=v.removeEvent,e=v.splat,c=v.uniqueKey,m=g.charts,u=g.deg2rad,L=g.doc,F=g.isFirefox,w=g.isMS,p=g.isWebKit;v=g.noop;var C=g.svg,O=g.SVG_NS,B=g.symbolSizes,d=g.win;k=g.SVGRenderer=function(){this.init.apply(this,arguments)};E(k.prototype, {Element:H,SVG_NS:O,init:function(b,n,x,a,c,e,f){var m=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"});f||m.css(this.getStyle(a));a=m.element;b.appendChild(a);N(b,"dir","ltr");-1===b.innerHTML.indexOf("xmlns")&&N(a,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=a;this.boxWrapper=m;this.alignedObjects=[];this.url=(F||p)&&L.getElementsByTagName("base").length?d.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(L.createTextNode("Created with Highcharts 8.1.0")); this.defs=this.createElement("defs").add();this.allowHTML=e;this.forExport=c;this.styledMode=f;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(n,x,!1);var u;F&&b.getBoundingClientRect&&(n=function(){y(b,{left:0,top:0});u=b.getBoundingClientRect();y(b,{left:Math.ceil(u.left)-u.left+"px",top:Math.ceil(u.top)-u.top+"px"})},n(),this.unSubPixelFix=G(d,"resize",n))},definition:function(b){function d(b,n){var x;e(b).forEach(function(b){var c=a.createElement(b.tagName),e={}; h(b,function(b,d){"tagName"!==d&&"children"!==d&&"textContent"!==d&&(e[d]=b)});c.attr(e);c.add(n||a.defs);b.textContent&&c.element.appendChild(L.createTextNode(b.textContent));d(b.children||[],c);x=c});return x}var a=this;return d(b)},getStyle:function(b){return this.style=E({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},b)},setStyle:function(b){this.boxWrapper.css(this.getStyle(b))},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var b= this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();J(this.gradients||{});this.gradients=null;b&&(this.defs=b.destroy());this.unSubPixelFix&&this.unSubPixelFix();return this.alignedObjects=null},createElement:function(b){var d=new this.Element;d.init(this,b);return d},draw:v,getRadialAttr:function(b,d){return{cx:b[0]-b[2]/2+d.cx*b[2],cy:b[1]-b[2]/2+d.cy*b[2],r:d.r*b[2]}},truncate:function(b,d,a,c,e,f,m){var n=this,x=b.rotation,u,p=c?1:0,h=(a||c).length,w=h,l=[],C=function(b){d.firstChild&& d.removeChild(d.firstChild);b&&d.appendChild(L.createTextNode(b))},F=function(x,f){f=f||x;if("undefined"===typeof l[f])if(d.getSubStringLength)try{l[f]=e+d.getSubStringLength(0,c?f+1:f)}catch(ea){""}else n.getSpanWidth&&(C(m(a||c,x)),l[f]=e+n.getSpanWidth(b,d));return l[f]},Q;b.rotation=0;var R=F(d.textContent.length);if(Q=e+R>f){for(;p<=h;)w=Math.ceil((p+h)/2),c&&(u=m(c,w)),R=F(w,u&&u.length-1),p===h?p=h+1:R>f?h=w-1:p=w;0===h?C(""):a&&h===a.length-1||C(u||m(a||c,w))}c&&c.splice(0,w);b.actualWidth= R;b.rotation=x;return Q},escapes:{"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"},buildText:function(b){var d=b.element,x=this,c=x.forExport,e=f(b.textStr,"").toString(),m=-1!==e.indexOf("<"),u=d.childNodes,p,w=N(d,"x"),l=b.styles,F=b.textWidth,B=l&&l.lineHeight,r=l&&l.textOutline,t=l&&"ellipsis"===l.textOverflow,q=l&&"nowrap"===l.whiteSpace,z=l&&l.fontSize,g,k=u.length;l=F&&!b.added&&this.box;var D=function(b){var n;x.styledMode||(n=/(px|em)$/.test(b&&b.style.fontSize)?b.style.fontSize: z||x.style.fontSize||12);return B?a(B):x.fontMetrics(n,b.getAttribute("style")?b:d).h},E=function(b,d){h(x.escapes,function(n,a){d&&-1!==d.indexOf(n)||(b=b.toString().replace(new RegExp(n,"g"),a))});return b},v=function(b,d){var n=b.indexOf("<");b=b.substring(n,b.indexOf(">")-n);n=b.indexOf(d+"=");if(-1!==n&&(n=n+d.length+1,d=b.charAt(n),'"'===d||"'"===d))return b=b.substring(n+1),b.substring(0,b.indexOf(d))},I=/<br.*?>/g;var J=[e,t,q,B,r,z,F].join();if(J!==b.textCache){for(b.textCache=J;k--;)d.removeChild(u[k]); m||r||t||F||-1!==e.indexOf(" ")&&(!q||I.test(e))?(l&&l.appendChild(d),m?(e=x.styledMode?e.replace(/<(b|strong)>/g,'<span class="highcharts-strong">').replace(/<(i|em)>/g,'<span class="highcharts-emphasized">'):e.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">'),e=e.replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(I)):e=[e],e=e.filter(function(b){return""!==b}),e.forEach(function(n,a){var e=0,f=0;n=n.replace(/^\s+|\s+$/g, "").replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");var m=n.split("|||");m.forEach(function(n){if(""!==n||1===m.length){var u={},h=L.createElementNS(x.SVG_NS,"tspan"),l,Q;(l=v(n,"class"))&&N(h,"class",l);if(l=v(n,"style"))l=l.replace(/(;| |^)color([ :])/,"$1fill$2"),N(h,"style",l);(Q=v(n,"href"))&&!c&&(N(h,"onclick",'location.href="'+Q+'"'),N(h,"class","highcharts-anchor"),x.styledMode||y(h,{cursor:"pointer"}));n=E(n.replace(/<[a-zA-Z\/](.|\n)*?>/g,"")||" ");if(" "!==n){h.appendChild(L.createTextNode(n)); e?u.dx=0:a&&null!==w&&(u.x=w);N(h,u);d.appendChild(h);!e&&g&&(!C&&c&&y(h,{display:"block"}),N(h,"dy",D(h)));if(F){var R=n.replace(/([^\^])-/g,"$1- ").split(" ");u=!q&&(1<m.length||a||1<R.length);Q=0;var B=D(h);if(t)p=x.truncate(b,h,n,void 0,0,Math.max(0,F-parseInt(z||12,10)),function(b,d){return b.substring(0,d)+"\u2026"});else if(u)for(;R.length;)R.length&&!q&&0<Q&&(h=L.createElementNS(O,"tspan"),N(h,{dy:B,x:w}),l&&N(h,"style",l),h.appendChild(L.createTextNode(R.join(" ").replace(/- /g,"-"))),d.appendChild(h)), x.truncate(b,h,null,R,0===Q?f:0,F,function(b,d){return R.slice(0,d).join(" ").replace(/- /g,"-")}),f=b.actualWidth,Q++}e++}}});g=g||d.childNodes.length}),t&&p&&b.attr("title",E(b.textStr,["&lt;","&gt;"])),l&&l.removeChild(d),r&&b.applyTextOutline&&b.applyTextOutline(r)):d.appendChild(L.createTextNode(E(e)))}},getContrast:function(b){b=K(b).rgba;b[0]*=1;b[1]*=1.2;b[2]*=.5;return 459<b[0]+b[1]+b[2]?"#000000":"#FFFFFF"},button:function(b,d,a,c,e,f,m,u,h,p){var n=this.label(b,d,a,h,void 0,void 0,p,void 0, "button"),x=0,l=this.styledMode;n.attr(r({padding:8,r:2},e));if(!l){e=r({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer",fontWeight:"normal"}},e);var C=e.style;delete e.style;f=r(e,{fill:"#e6e6e6"},f);var F=f.style;delete f.style;m=r(e,{fill:"#e6ebf5",style:{color:"#000000",fontWeight:"bold"}},m);var Q=m.style;delete m.style;u=r(e,{style:{color:"#cccccc"}},u);var R=u.style;delete u.style}G(n.element,w?"mouseover":"mouseenter",function(){3!==x&&n.setState(1)}); G(n.element,w?"mouseout":"mouseleave",function(){3!==x&&n.setState(x)});n.setState=function(b){1!==b&&(n.state=x=b);n.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][b||0]);l||n.attr([e,f,m,u][b||0]).css([C,F,Q,R][b||0])};l||n.attr(e).css(E({cursor:"default"},C));return n.on("click",function(b){3!==x&&c.call(n,b)})},crispLine:function(b,d,a){void 0===a&&(a="round");var n=b[0],x=b[1];n[1]===x[1]&&(n[1]=x[1]=Math[a](n[1])- d%2/2);n[2]===x[2]&&(n[2]=x[2]=Math[a](n[2])+d%2/2);return b},path:function(b){var d=this.styledMode?{}:{fill:"none"};D(b)?d.d=b:t(b)&&E(d,b);return this.createElement("path").attr(d)},circle:function(b,d,a){b=t(b)?b:"undefined"===typeof b?{}:{x:b,y:d,r:a};d=this.createElement("circle");d.xSetter=d.ySetter=function(b,d,n){n.setAttribute("c"+d,b)};return d.attr(b)},arc:function(b,d,a,c,e,f){t(b)?(c=b,d=c.y,a=c.r,b=c.x):c={innerR:c,start:e,end:f};b=this.symbol("arc",b,d,a,a,c);b.r=a;return b},rect:function(b, d,a,c,e,f){e=t(b)?b.r:e;var n=this.createElement("rect");b=t(b)?b:"undefined"===typeof b?{}:{x:b,y:d,width:Math.max(a,0),height:Math.max(c,0)};this.styledMode||("undefined"!==typeof f&&(b.strokeWidth=f,b=n.crisp(b)),b.fill="none");e&&(b.r=e);n.rSetter=function(b,d,a){n.r=b;N(a,{rx:b,ry:b})};n.rGetter=function(){return n.r};return n.attr(b)},setSize:function(b,d,a){var n=this.alignedObjects,c=n.length;this.width=b;this.height=d;for(this.boxWrapper.animate({width:b,height:d},{step:function(){this.attr({viewBox:"0 0 "+ this.attr("width")+" "+this.attr("height")})},duration:f(a,!0)?void 0:0});c--;)n[c].align()},g:function(b){var d=this.createElement("g");return b?d.attr({"class":"highcharts-"+b}):d},image:function(b,n,a,c,e,f){var x={preserveAspectRatio:"none"},m=function(b,d){b.setAttributeNS?b.setAttributeNS("http://www.w3.org/1999/xlink","href",d):b.setAttribute("hc-svg-href",d)},u=function(d){m(h.element,b);f.call(h,d)};1<arguments.length&&E(x,{x:n,y:a,width:c,height:e});var h=this.createElement("image").attr(x); f?(m(h.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),x=new d.Image,G(x,"load",u),x.src=b,x.complete&&u({})):m(h.element,b);return h},symbol:function(b,d,a,c,e,u){var n=this,x=/^url\((.*?)\)$/,h=x.test(b),p=!h&&(this.symbols[b]?b:"circle"),w=p&&this.symbols[p],l;if(w){"number"===typeof d&&(l=w.call(this.symbols,Math.round(d||0),Math.round(a||0),c,e,u));var C=this.path(l);n.styledMode||C.attr("fill","none");E(C,{symbolName:p,x:d,y:a,width:c,height:e});u&&E(C, u)}else if(h){var F=b.match(x)[1];C=this.image(F);C.imgwidth=f(B[F]&&B[F].width,u&&u.width);C.imgheight=f(B[F]&&B[F].height,u&&u.height);var Q=function(){C.attr({width:C.width,height:C.height})};["width","height"].forEach(function(b){C[b+"Setter"]=function(b,d){var n={},a=this["img"+d],c="width"===d?"translateX":"translateY";this[d]=b;I(a)&&(u&&"within"===u.backgroundSize&&this.width&&this.height&&(a=Math.round(a*Math.min(this.width/this.imgwidth,this.height/this.imgheight))),this.element&&this.element.setAttribute(d, a),this.alignByTranslate||(n[c]=((this[d]||0)-a)/2,this.attr(n)))}});I(d)&&C.attr({x:d,y:a});C.isImg=!0;I(C.imgwidth)&&I(C.imgheight)?Q():(C.attr({width:0,height:0}),M("img",{onload:function(){var b=m[n.chartIndex];0===this.width&&(y(this,{position:"absolute",top:"-999em"}),L.body.appendChild(this));B[F]={width:this.width,height:this.height};C.imgwidth=this.width;C.imgheight=this.height;C.element&&Q();this.parentNode&&this.parentNode.removeChild(this);n.imgCount--;if(!n.imgCount&&b&&!b.hasLoaded)b.onload()}, src:F}),this.imgCount++)}return C},symbols:{circle:function(b,d,a,c){return this.arc(b+a/2,d+c/2,a/2,c/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},square:function(b,d,a,c){return[["M",b,d],["L",b+a,d],["L",b+a,d+c],["L",b,d+c],["Z"]]},triangle:function(b,d,a,c){return[["M",b+a/2,d],["L",b+a,d+c],["L",b,d+c],["Z"]]},"triangle-down":function(b,d,a,c){return[["M",b,d],["L",b+a,d],["L",b+a/2,d+c],["Z"]]},diamond:function(b,d,a,c){return[["M",b+a/2,d],["L",b+a,d+c/2],["L",b+a/2,d+c],["L",b,d+c/2],["Z"]]}, arc:function(b,d,a,c,e){var n=e.start,x=e.r||a,m=e.r||c||a,u=e.end-.001;a=e.innerR;c=f(e.open,.001>Math.abs(e.end-e.start-2*Math.PI));var h=Math.cos(n),p=Math.sin(n),w=Math.cos(u);u=Math.sin(u);n=f(e.longArc,.001>e.end-n-Math.PI?0:1);x=[["M",b+x*h,d+m*p],["A",x,m,0,n,f(e.clockwise,1),b+x*w,d+m*u]];I(a)&&x.push(c?["M",b+a*w,d+a*u]:["L",b+a*w,d+a*u],["A",a,a,0,n,I(e.clockwise)?1-e.clockwise:0,b+a*h,d+a*p]);c||x.push(["Z"]);return x},callout:function(b,d,a,c,e){var n=Math.min(e&&e.r||0,a,c),x=n+6,f= e&&e.anchorX;e=e&&e.anchorY;var m=[["M",b+n,d],["L",b+a-n,d],["C",b+a,d,b+a,d,b+a,d+n],["L",b+a,d+c-n],["C",b+a,d+c,b+a,d+c,b+a-n,d+c],["L",b+n,d+c],["C",b,d+c,b,d+c,b,d+c-n],["L",b,d+n],["C",b,d,b,d,b+n,d]];f&&f>a?e>d+x&&e<d+c-x?m.splice(3,1,["L",b+a,e-6],["L",b+a+6,e],["L",b+a,e+6],["L",b+a,d+c-n]):m.splice(3,1,["L",b+a,c/2],["L",f,e],["L",b+a,c/2],["L",b+a,d+c-n]):f&&0>f?e>d+x&&e<d+c-x?m.splice(7,1,["L",b,e+6],["L",b-6,e],["L",b,e-6],["L",b,d+n]):m.splice(7,1,["L",b,c/2],["L",f,e],["L",b,c/2], ["L",b,d+n]):e&&e>c&&f>b+x&&f<b+a-x?m.splice(5,1,["L",f+6,d+c],["L",f,d+c+6],["L",f-6,d+c],["L",b+n,d+c]):e&&0>e&&f>b+x&&f<b+a-x&&m.splice(1,1,["L",f-6,d],["L",f,d-6],["L",f+6,d],["L",a-n,d]);return m}},clipRect:function(b,d,a,e){var n=c()+"-",x=this.createElement("clipPath").attr({id:n}).add(this.defs);b=this.rect(b,d,a,e,0).add(x);b.id=n;b.clipPath=x;b.count=0;return b},text:function(b,d,a,c){var n={};if(c&&(this.allowHTML||!this.forExport))return this.html(b,d,a);n.x=Math.round(d||0);a&&(n.y=Math.round(a)); I(b)&&(n.text=b);b=this.createElement("text").attr(n);c||(b.xSetter=function(b,d,n){var a=n.getElementsByTagName("tspan"),c=n.getAttribute(d),e;for(e=0;e<a.length;e++){var x=a[e];x.getAttribute(d)===c&&x.setAttribute(d,b)}n.setAttribute(d,b)});return b},fontMetrics:function(b,n){b=!this.styledMode&&/px/.test(b)||!d.getComputedStyle?b||n&&n.style&&n.style.fontSize||this.style&&this.style.fontSize:n&&H.prototype.getStyle.call(n,"font-size");b=/px/.test(b)?a(b):12;n=24>b?b+3:Math.round(1.2*b);return{h:n, b:Math.round(.8*n),f:b}},rotCorr:function(b,d,a){var n=b;d&&a&&(n=Math.max(n*Math.cos(d*u),4));return{x:-b/3*Math.sin(d*u),y:n}},pathToSegments:function(b){for(var d=[],a=[],c={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},e=0;e<b.length;e++)q(a[0])&&z(b[e])&&a.length===c[a[0].toUpperCase()]&&b.splice(e,0,a[0].replace("M","L").replace("m","l")),"string"===typeof b[e]&&(a.length&&d.push(a.slice(0)),a.length=0),a.push(b[e]);d.push(a.slice(0));return d},label:function(b,d,a,c,e,f,m,u,h){var n=this,x=n.styledMode, p=n.g("button"!==h&&"label"),w=p.text=n.text("",0,0,m).attr({zIndex:1}),C,F={width:0,height:0,x:0,y:0},Q=F,B=0,L=3,t=0,O,q,R,X,g,k={},y,D,U=/^url\((.*?)\)$/.test(c),v=x||U,W=function(){return x?C.strokeWidth()%2/2:(y?parseInt(y,10):0)%2/2};h&&p.addClass("highcharts-"+h);var V=function(){var b=w.element.style,d={};Q=z(O)&&z(q)&&!g||!I(w.textStr)?F:w.getBBox();p.width=(O||Q.width||0)+2*L+t;p.height=(q||Q.height||0)+2*L;D=L+Math.min(n.fontMetrics(b&&b.fontSize,w).b,Q.height||Infinity);v&&(C||(p.box= C=n.symbols[c]||U?n.symbol(c):n.rect(),C.addClass(("button"===h?"":"highcharts-label-box")+(h?" highcharts-"+h+"-box":"")),C.add(p),b=W(),d.x=b,d.y=(u?-D:0)+b),d.width=Math.round(p.width),d.height=Math.round(p.height),C.attr(E(d,k)),k={})};var J=function(){var b=t+L;var d=u?0:D;I(O)&&Q&&("center"===g||"right"===g)&&(b+={center:.5,right:1}[g]*(O-Q.width));if(b!==w.x||d!==w.y)w.attr("x",b),w.hasBoxWidthChanged&&(Q=w.getBBox(!0),V()),"undefined"!==typeof d&&w.attr("y",d);w.x=b;w.y=d};var M=function(b, d){C?C.attr(b,d):k[b]=d};p.onAdd=function(){w.add(p);p.attr({text:b||0===b?b:"",x:d,y:a});C&&I(e)&&p.attr({anchorX:e,anchorY:f})};p.widthSetter=function(b){O=z(b)?b:null};p.heightSetter=function(b){q=b};p["text-alignSetter"]=function(b){g=b};p.paddingSetter=function(b){I(b)&&b!==L&&(L=p.padding=b,J())};p.paddingLeftSetter=function(b){I(b)&&b!==t&&(t=b,J())};p.alignSetter=function(b){b={left:0,center:.5,right:1}[b];b!==B&&(B=b,Q&&p.attr({x:R}))};p.textSetter=function(b){"undefined"!==typeof b&&w.attr({text:b}); V();J()};p["stroke-widthSetter"]=function(b,d){b&&(v=!0);y=this["stroke-width"]=b;M(d,b)};x?p.rSetter=function(b,d){M(d,b)}:p.strokeSetter=p.fillSetter=p.rSetter=function(b,d){"r"!==d&&("fill"===d&&b&&(v=!0),p[d]=b);M(d,b)};p.anchorXSetter=function(b,d){e=p.anchorX=b;M(d,Math.round(b)-W()-R)};p.anchorYSetter=function(b,d){f=p.anchorY=b;M(d,b-X)};p.xSetter=function(b){p.x=b;B&&(b-=B*((O||Q.width)+2*L),p["forceAnimate:x"]=!0);R=Math.round(b);p.attr("translateX",R)};p.ySetter=function(b){X=p.y=Math.round(b); p.attr("translateY",X)};p.isLabel=!0;var G=p.css;m={css:function(b){if(b){var d={};b=r(b);p.textProps.forEach(function(n){"undefined"!==typeof b[n]&&(d[n]=b[n],delete b[n])});w.css(d);var n="fontSize"in d||"fontWeight"in d;if("width"in d||n)V(),n&&J()}return G.call(p,b)},getBBox:function(){return{width:Q.width+2*L,height:Q.height+2*L,x:Q.x-L,y:Q.y-L}},destroy:function(){l(p.element,"mouseenter");l(p.element,"mouseleave");w&&w.destroy();C&&(C=C.destroy());H.prototype.destroy.call(p);p=n=w=V=J=M=null}}; p.on=function(b,d){var n=w&&"SPAN"===w.element.tagName?w:void 0;if(n){var a=function(a){("mouseenter"===b||"mouseleave"===b)&&a.relatedTarget instanceof Element&&(p.element.contains(a.relatedTarget)||n.element.contains(a.relatedTarget))||d.call(p.element,a)};n.on(b,a)}H.prototype.on.call(p,b,a||d);return p};x||(m.shadow=function(b){b&&(V(),C&&C.shadow(b));return p});return E(p,m)}});g.Renderer=k});P(A,"parts/Html.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.attr,v=g.createElement, K=g.css,G=g.defined,N=g.extend,M=g.pick,y=g.pInt,I=k.isFirefox,J=k.isMS,E=k.isWebKit,D=k.SVGElement;g=k.SVGRenderer;var z=k.win;N(D.prototype,{htmlCss:function(t){var q="SPAN"===this.element.tagName&&t&&"width"in t,r=M(q&&t.width,void 0);if(q){delete t.width;this.textWidth=r;var h=!0}t&&"ellipsis"===t.textOverflow&&(t.whiteSpace="nowrap",t.overflow="hidden");this.styles=N(this.styles,t);K(this.element,t);h&&this.htmlUpdateTransform();return this},htmlGetBBox:function(){var t=this.element;return{x:t.offsetLeft, y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var t=this.renderer,q=this.element,r=this.translateX||0,h=this.translateY||0,f=this.x||0,a=this.y||0,l=this.textAlign||"left",e={left:0,center:.5,right:1}[l],c=this.styles,m=c&&c.whiteSpace;K(q,{marginLeft:r,marginTop:h});!t.styledMode&&this.shadows&&this.shadows.forEach(function(a){K(a,{marginLeft:r+1,marginTop:h+1})});this.inverted&&[].forEach.call(q.childNodes,function(a){t.invertChild(a,q)}); if("SPAN"===q.tagName){c=this.rotation;var u=this.textWidth&&y(this.textWidth),L=[c,l,q.innerHTML,this.textWidth,this.textAlign].join(),F;(F=u!==this.oldTextWidth)&&!(F=u>this.oldTextWidth)&&((F=this.textPxLength)||(K(q,{width:"",whiteSpace:m||"nowrap"}),F=q.offsetWidth),F=F>u);F&&(/[ \-]/.test(q.textContent||q.innerText)||"ellipsis"===q.style.textOverflow)?(K(q,{width:u+"px",display:"block",whiteSpace:m||"normal"}),this.oldTextWidth=u,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1;L!==this.cTT&& (m=t.fontMetrics(q.style.fontSize,q).b,!G(c)||c===(this.oldRotation||0)&&l===this.oldAlign||this.setSpanRotation(c,e,m),this.getSpanCorrection(!G(c)&&this.textPxLength||q.offsetWidth,m,e,c,l));K(q,{left:f+(this.xCorr||0)+"px",top:a+(this.yCorr||0)+"px"});this.cTT=L;this.oldRotation=c;this.oldAlign=l}}else this.alignOnAdd=!0},setSpanRotation:function(t,q,r){var h={},f=this.renderer.getTransformKey();h[f]=h.transform="rotate("+t+"deg)";h[f+(I?"Origin":"-origin")]=h.transformOrigin=100*q+"% "+r+"px"; K(this.element,h)},getSpanCorrection:function(t,q,r){this.xCorr=-t*r;this.yCorr=-q}});N(g.prototype,{getTransformKey:function(){return J&&!/Edge/.test(z.navigator.userAgent)?"-ms-transform":E?"-webkit-transform":I?"MozTransform":z.opera?"-o-transform":""},html:function(t,q,r){var h=this.createElement("span"),f=h.element,a=h.renderer,l=a.isSVG,e=function(a,e){["opacity","visibility"].forEach(function(c){a[c+"Setter"]=function(f,m,u){var p=a.div?a.div.style:e;D.prototype[c+"Setter"].call(this,f,m,u); p&&(p[m]=f)}});a.addedSetters=!0};h.textSetter=function(a){a!==f.innerHTML&&(delete this.bBox,delete this.oldTextWidth);this.textStr=a;f.innerHTML=M(a,"");h.doTransform=!0};l&&e(h,h.element.style);h.xSetter=h.ySetter=h.alignSetter=h.rotationSetter=function(a,e){"align"===e&&(e="textAlign");h[e]=a;h.doTransform=!0};h.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)};h.attr({text:t,x:Math.round(q),y:Math.round(r)}).css({position:"absolute"});a.styledMode||h.css({fontFamily:this.style.fontFamily, fontSize:this.style.fontSize});f.style.whiteSpace="nowrap";h.css=h.htmlCss;l&&(h.add=function(c){var m=a.box.parentNode,u=[];if(this.parentGroup=c){var l=c.div;if(!l){for(;c;)u.push(c),c=c.parentGroup;u.reverse().forEach(function(a){function c(c,e){a[e]=c;"translateX"===e?C.left=c+"px":C.top=c+"px";a.doTransform=!0}var f=H(a.element,"class");l=a.div=a.div||v("div",f?{className:f}:void 0,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity, pointerEvents:a.styles&&a.styles.pointerEvents},l||m);var C=l.style;N(a,{classSetter:function(a){return function(c){this.element.setAttribute("class",c);a.className=c}}(l),on:function(){u[0].div&&h.on.apply({element:u[0].div},arguments);return a},translateXSetter:c,translateYSetter:c});a.addedSetters||e(a)})}}else l=m;l.appendChild(f);h.added=!0;h.alignOnAdd&&h.htmlUpdateTransform();return h});return h}})});P(A,"parts/Tick.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.clamp, v=g.correctFloat,K=g.defined,G=g.destroyObjectProperties,N=g.extend,M=g.fireEvent,y=g.isNumber,I=g.merge,J=g.objectEach,E=g.pick,D=k.deg2rad;g=function(){function z(t,q,r,h,f){this.isNewLabel=this.isNew=!0;this.axis=t;this.pos=q;this.type=r||"";this.parameters=f||{};this.tickmarkOffset=this.parameters.tickmarkOffset;this.options=this.parameters.options;M(this,"init");r||h||this.addLabel()}z.prototype.addLabel=function(){var t=this,q=t.axis,r=q.options,h=q.chart,f=q.categories,a=q.logarithmic,l=q.names, e=t.pos,c=E(t.options&&t.options.labels,r.labels),m=q.tickPositions,u=e===m[0],L=e===m[m.length-1];l=this.parameters.category||(f?E(f[e],l[e],e):e);var F=t.label;f=(!c.step||1===c.step)&&1===q.tickInterval;m=m.info;var w,p;if(q.dateTime&&m){var C=h.time.resolveDTLFormat(r.dateTimeLabelFormats[!r.grid&&m.higherRanks[e]||m.unitName]);var O=C.main}t.isFirst=u;t.isLast=L;t.formatCtx={axis:q,chart:h,isFirst:u,isLast:L,dateTimeLabelFormat:O,tickPositionInfo:m,value:a?v(a.lin2log(l)):l,pos:e};r=q.labelFormatter.call(t.formatCtx, this.formatCtx);if(p=C&&C.list)t.shortenLabel=function(){for(w=0;w<p.length;w++)if(F.attr({text:q.labelFormatter.call(N(t.formatCtx,{dateTimeLabelFormat:p[w]}))}),F.getBBox().width<q.getSlotWidth(t)-2*E(c.padding,5))return;F.attr({text:""})};f&&q._addedPlotLB&&q.isXAxis&&t.moveLabel(r,c);K(F)||t.movedLabel?F&&F.textStr!==r&&!f&&(!F.textWidth||c.style&&c.style.width||F.styles.width||F.css({width:null}),F.attr({text:r}),F.textPxLength=F.getBBox().width):(t.label=F=t.createLabel({x:0,y:0},r,c),t.rotation= 0)};z.prototype.createLabel=function(t,q,r){var h=this.axis,f=h.chart;if(t=K(q)&&r.enabled?f.renderer.text(q,t.x,t.y,r.useHTML).add(h.labelGroup):null)f.styledMode||t.css(I(r.style)),t.textPxLength=t.getBBox().width;return t};z.prototype.destroy=function(){G(this,this.axis)};z.prototype.getPosition=function(t,q,r,h){var f=this.axis,a=f.chart,l=h&&a.oldChartHeight||a.chartHeight;t={x:t?v(f.translate(q+r,null,null,h)+f.transB):f.left+f.offset+(f.opposite?(h&&a.oldChartWidth||a.chartWidth)-f.right-f.left: 0),y:t?l-f.bottom+f.offset-(f.opposite?f.height:0):v(l-f.translate(q+r,null,null,h)-f.transB)};t.y=H(t.y,-1E5,1E5);M(this,"afterGetPosition",{pos:t});return t};z.prototype.getLabelPosition=function(t,q,r,h,f,a,l,e){var c=this.axis,m=c.transA,u=c.isLinked&&c.linkedParent?c.linkedParent.reversed:c.reversed,L=c.staggerLines,F=c.tickRotCorr||{x:0,y:0},w=f.y,p=h||c.reserveSpaceDefault?0:-c.labelOffset*("center"===c.labelAlign?.5:1),C={};K(w)||(w=0===c.side?r.rotation?-8:-r.getBBox().height:2===c.side? F.y+8:Math.cos(r.rotation*D)*(F.y-r.getBBox(!1,0).height/2));t=t+f.x+p+F.x-(a&&h?a*m*(u?-1:1):0);q=q+w-(a&&!h?a*m*(u?1:-1):0);L&&(r=l/(e||1)%L,c.opposite&&(r=L-r-1),q+=c.labelOffset/L*r);C.x=t;C.y=Math.round(q);M(this,"afterGetLabelPosition",{pos:C,tickmarkOffset:a,index:l});return C};z.prototype.getLabelSize=function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0};z.prototype.getMarkPath=function(t,q,r,h,f,a){return a.crispLine([["M",t,q],["L",t+(f?0:-r),q+(f?r:0)]], h)};z.prototype.handleOverflow=function(t){var q=this.axis,r=q.options.labels,h=t.x,f=q.chart.chartWidth,a=q.chart.spacing,l=E(q.labelLeft,Math.min(q.pos,a[3]));a=E(q.labelRight,Math.max(q.isRadial?0:q.pos+q.len,f-a[1]));var e=this.label,c=this.rotation,m={left:0,center:.5,right:1}[q.labelAlign||e.attr("align")],u=e.getBBox().width,L=q.getSlotWidth(this),F=L,w=1,p,C={};if(c||"justify"!==E(r.overflow,"justify"))0>c&&h-m*u<l?p=Math.round(h/Math.cos(c*D)-l):0<c&&h+m*u>a&&(p=Math.round((f-h)/Math.cos(c* D)));else if(f=h+(1-m)*u,h-m*u<l?F=t.x+F*(1-m)-l:f>a&&(F=a-t.x+F*m,w=-1),F=Math.min(L,F),F<L&&"center"===q.labelAlign&&(t.x+=w*(L-F-m*(L-Math.min(u,F)))),u>F||q.autoRotation&&(e.styles||{}).width)p=F;p&&(this.shortenLabel?this.shortenLabel():(C.width=Math.floor(p)+"px",(r.style||{}).textOverflow||(C.textOverflow="ellipsis"),e.css(C)))};z.prototype.moveLabel=function(t,q){var r=this,h=r.label,f=!1,a=r.axis,l=a.reversed,e=a.chart.inverted;h&&h.textStr===t?(r.movedLabel=h,f=!0,delete r.label):J(a.ticks, function(a){f||a.isNew||a===r||!a.label||a.label.textStr!==t||(r.movedLabel=a.label,f=!0,a.labelPos=r.movedLabel.xy,delete a.label)});if(!f&&(r.labelPos||h)){var c=r.labelPos||h.xy;h=e?c.x:l?0:a.width+a.left;a=e?l?a.width+a.left:0:c.y;r.movedLabel=r.createLabel({x:h,y:a},t,q);r.movedLabel&&r.movedLabel.attr({opacity:0})}};z.prototype.render=function(t,q,r){var h=this.axis,f=h.horiz,a=this.pos,l=E(this.tickmarkOffset,h.tickmarkOffset);a=this.getPosition(f,a,l,q);l=a.x;var e=a.y;h=f&&l===h.pos+h.len|| !f&&e===h.pos?-1:1;r=E(r,1);this.isActive=!0;this.renderGridLine(q,r,h);this.renderMark(a,r,h);this.renderLabel(a,q,r,t);this.isNew=!1;M(this,"afterRender")};z.prototype.renderGridLine=function(t,q,r){var h=this.axis,f=h.options,a=this.gridLine,l={},e=this.pos,c=this.type,m=E(this.tickmarkOffset,h.tickmarkOffset),u=h.chart.renderer,L=c?c+"Grid":"grid",F=f[L+"LineWidth"],w=f[L+"LineColor"];f=f[L+"LineDashStyle"];a||(h.chart.styledMode||(l.stroke=w,l["stroke-width"]=F,f&&(l.dashstyle=f)),c||(l.zIndex= 1),t&&(q=0),this.gridLine=a=u.path().attr(l).addClass("highcharts-"+(c?c+"-":"")+"grid-line").add(h.gridGroup));if(a&&(r=h.getPlotLinePath({value:e+m,lineWidth:a.strokeWidth()*r,force:"pass",old:t})))a[t||this.isNew?"attr":"animate"]({d:r,opacity:q})};z.prototype.renderMark=function(t,q,r){var h=this.axis,f=h.options,a=h.chart.renderer,l=this.type,e=l?l+"Tick":"tick",c=h.tickSize(e),m=this.mark,u=!m,L=t.x;t=t.y;var F=E(f[e+"Width"],!l&&h.isXAxis?1:0);f=f[e+"Color"];c&&(h.opposite&&(c[0]=-c[0]),u&& (this.mark=m=a.path().addClass("highcharts-"+(l?l+"-":"")+"tick").add(h.axisGroup),h.chart.styledMode||m.attr({stroke:f,"stroke-width":F})),m[u?"attr":"animate"]({d:this.getMarkPath(L,t,c[0],m.strokeWidth()*r,h.horiz,a),opacity:q}))};z.prototype.renderLabel=function(t,q,r,h){var f=this.axis,a=f.horiz,l=f.options,e=this.label,c=l.labels,m=c.step;f=E(this.tickmarkOffset,f.tickmarkOffset);var u=!0,L=t.x;t=t.y;e&&y(L)&&(e.xy=t=this.getLabelPosition(L,t,e,a,c,f,h,m),this.isFirst&&!this.isLast&&!E(l.showFirstLabel, 1)||this.isLast&&!this.isFirst&&!E(l.showLastLabel,1)?u=!1:!a||c.step||c.rotation||q||0===r||this.handleOverflow(t),m&&h%m&&(u=!1),u&&y(t.y)?(t.opacity=r,e[this.isNewLabel?"attr":"animate"](t),this.isNewLabel=!1):(e.attr("y",-9999),this.isNewLabel=!0))};z.prototype.replaceMovedLabel=function(){var t=this.label,q=this.axis,r=q.reversed,h=this.axis.chart.inverted;if(t&&!this.isNew){var f=h?t.xy.x:r?q.left:q.width+q.left;r=h?r?q.width+q.top:q.top:t.xy.y;t.animate({x:f,y:r,opacity:0},void 0,t.destroy); delete this.label}q.isDirty=!0;this.label=this.movedLabel;delete this.movedLabel};return z}();k.Tick=g;return k.Tick});P(A,"parts/Time.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.defined,v=g.error,K=g.extend,G=g.isObject,N=g.merge,M=g.objectEach,y=g.pad,I=g.pick,J=g.splat,E=g.timeUnits,D=k.win;g=function(){function z(t){this.options={};this.variableTimezone=this.useUTC=!1;this.Date=D.Date;this.getTimezoneOffset=this.timezoneOffsetFunction();this.update(t)}z.prototype.get= function(t,q){if(this.variableTimezone||this.timezoneOffset){var r=q.getTime(),h=r-this.getTimezoneOffset(q);q.setTime(h);t=q["getUTC"+t]();q.setTime(r);return t}return this.useUTC?q["getUTC"+t]():q["get"+t]()};z.prototype.set=function(t,q,r){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===t||"Seconds"===t||"Minutes"===t)return q["setUTC"+t](r);var h=this.getTimezoneOffset(q);h=q.getTime()-h;q.setTime(h);q["setUTC"+t](r);t=this.getTimezoneOffset(q);h=q.getTime()+t;return q.setTime(h)}return this.useUTC? q["setUTC"+t](r):q["set"+t](r)};z.prototype.update=function(t){var q=I(t&&t.useUTC,!0);this.options=t=N(!0,this.options||{},t);this.Date=t.Date||D.Date||Date;this.timezoneOffset=(this.useUTC=q)&&t.timezoneOffset;this.getTimezoneOffset=this.timezoneOffsetFunction();this.variableTimezone=!(q&&!t.getTimezoneOffset&&!t.timezone)};z.prototype.makeTime=function(t,q,r,h,f,a){if(this.useUTC){var l=this.Date.UTC.apply(0,arguments);var e=this.getTimezoneOffset(l);l+=e;var c=this.getTimezoneOffset(l);e!==c? l+=c-e:e-36E5!==this.getTimezoneOffset(l-36E5)||k.isSafari||(l-=36E5)}else l=(new this.Date(t,q,I(r,1),I(h,0),I(f,0),I(a,0))).getTime();return l};z.prototype.timezoneOffsetFunction=function(){var t=this,q=this.options,r=D.moment;if(!this.useUTC)return function(h){return 6E4*(new Date(h.toString())).getTimezoneOffset()};if(q.timezone){if(r)return function(h){return 6E4*-r.tz(h,q.timezone).utcOffset()};v(25)}return this.useUTC&&q.getTimezoneOffset?function(h){return 6E4*q.getTimezoneOffset(h.valueOf())}: function(){return 6E4*(t.timezoneOffset||0)}};z.prototype.dateFormat=function(t,q,r){var h;if(!H(q)||isNaN(q))return(null===(h=k.defaultOptions.lang)||void 0===h?void 0:h.invalidDate)||"";t=I(t,"%Y-%m-%d %H:%M:%S");var f=this;h=new this.Date(q);var a=this.get("Hours",h),l=this.get("Day",h),e=this.get("Date",h),c=this.get("Month",h),m=this.get("FullYear",h),u=k.defaultOptions.lang,L=null===u||void 0===u?void 0:u.weekdays,F=null===u||void 0===u?void 0:u.shortWeekdays;h=K({a:F?F[l]:L[l].substr(0,3), A:L[l],d:y(e),e:y(e,2," "),w:l,b:u.shortMonths[c],B:u.months[c],m:y(c+1),o:c+1,y:m.toString().substr(2,2),Y:m,H:y(a),k:a,I:y(a%12||12),l:a%12||12,M:y(this.get("Minutes",h)),p:12>a?"AM":"PM",P:12>a?"am":"pm",S:y(h.getSeconds()),L:y(Math.floor(q%1E3),3)},k.dateFormats);M(h,function(a,c){for(;-1!==t.indexOf("%"+c);)t=t.replace("%"+c,"function"===typeof a?a.call(f,q):a)});return r?t.substr(0,1).toUpperCase()+t.substr(1):t};z.prototype.resolveDTLFormat=function(t){return G(t,!0)?t:(t=J(t),{main:t[0],from:t[1], to:t[2]})};z.prototype.getTimeTicks=function(t,q,r,h){var f=this,a=[],l={};var e=new f.Date(q);var c=t.unitRange,m=t.count||1,u;h=I(h,1);if(H(q)){f.set("Milliseconds",e,c>=E.second?0:m*Math.floor(f.get("Milliseconds",e)/m));c>=E.second&&f.set("Seconds",e,c>=E.minute?0:m*Math.floor(f.get("Seconds",e)/m));c>=E.minute&&f.set("Minutes",e,c>=E.hour?0:m*Math.floor(f.get("Minutes",e)/m));c>=E.hour&&f.set("Hours",e,c>=E.day?0:m*Math.floor(f.get("Hours",e)/m));c>=E.day&&f.set("Date",e,c>=E.month?1:Math.max(1, m*Math.floor(f.get("Date",e)/m)));if(c>=E.month){f.set("Month",e,c>=E.year?0:m*Math.floor(f.get("Month",e)/m));var L=f.get("FullYear",e)}c>=E.year&&f.set("FullYear",e,L-L%m);c===E.week&&(L=f.get("Day",e),f.set("Date",e,f.get("Date",e)-L+h+(L<h?-7:0)));L=f.get("FullYear",e);h=f.get("Month",e);var F=f.get("Date",e),w=f.get("Hours",e);q=e.getTime();f.variableTimezone&&(u=r-q>4*E.month||f.getTimezoneOffset(q)!==f.getTimezoneOffset(r));q=e.getTime();for(e=1;q<r;)a.push(q),q=c===E.year?f.makeTime(L+e*m, 0):c===E.month?f.makeTime(L,h+e*m):!u||c!==E.day&&c!==E.week?u&&c===E.hour&&1<m?f.makeTime(L,h,F,w+e*m):q+c*m:f.makeTime(L,h,F+e*m*(c===E.day?1:7)),e++;a.push(q);c<=E.hour&&1E4>a.length&&a.forEach(function(a){0===a%18E5&&"000000000"===f.dateFormat("%H%M%S%L",a)&&(l[a]="day")})}a.info=K(t,{higherRanks:l,totalRange:c*m});return a};z.defaultOptions={Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0};return z}();k.Time=g;return k.Time});P(A,"parts/Options.js",[A["parts/Globals.js"], A["parts/Time.js"],A["parts/Color.js"],A["parts/Utilities.js"]],function(k,g,H,v){H=H.parse;var K=v.merge;k.defaultOptions={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:g.defaultOptions,chart:{styledMode:!1,borderRadius:0,colorCount:10,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},width:null,height:null,borderColor:"#335cad",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"},title:{text:"Chart title",align:"center",margin:15, widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"}, itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:k.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L", second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:k.isTouchDevice?25:10,headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:H("#f7f7f7").setOpacity(.85).get(),borderWidth:1,shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px", whiteSpace:"nowrap"}},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};k.setOptions=function(g){k.defaultOptions=K(!0,k.defaultOptions,g);(g.time||g.global)&&k.time.update(K(k.defaultOptions.global,k.defaultOptions.time,g.global,g.time));return k.defaultOptions};k.getOptions=function(){return k.defaultOptions};k.defaultPlotOptions=k.defaultOptions.plotOptions; k.time=new g(K(k.defaultOptions.global,k.defaultOptions.time));k.dateFormat=function(g,v,M){return k.time.dateFormat(g,v,M)};""});P(A,"parts/Axis.js",[A["parts/Color.js"],A["parts/Globals.js"],A["parts/Tick.js"],A["parts/Utilities.js"]],function(k,g,H,v){var K=v.addEvent,G=v.animObject,N=v.arrayMax,M=v.arrayMin,y=v.clamp,I=v.correctFloat,J=v.defined,E=v.destroyObjectProperties,D=v.error,z=v.extend,t=v.fireEvent,q=v.format,r=v.getMagnitude,h=v.isArray,f=v.isFunction,a=v.isNumber,l=v.isString,e=v.merge, c=v.normalizeTickInterval,m=v.objectEach,u=v.pick,L=v.relativeLength,F=v.removeEvent,w=v.splat,p=v.syncTimeout,C=g.defaultOptions,O=g.deg2rad;v=function(){function B(d,b){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups= this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.oldMin=this.oldMax=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0;this.init(d,b)}B.prototype.init=function(d,b){var a=b.isX,c=this;c.chart=d; c.horiz=d.inverted&&!c.isZAxis?!a:a;c.isXAxis=a;c.coll=c.coll||(a?"xAxis":"yAxis");t(this,"init",{userOptions:b});c.opposite=b.opposite;c.side=b.side||(c.horiz?c.opposite?0:2:c.opposite?1:3);c.setOptions(b);var e=this.options,p=e.type;c.labelFormatter=e.labels.formatter||c.defaultLabelFormatter;c.userOptions=b;c.minPixelPadding=0;c.reversed=e.reversed;c.visible=!1!==e.visible;c.zoomEnabled=!1!==e.zoomEnabled;c.hasNames="category"===p||!0===e.categories;c.categories=e.categories||c.hasNames;c.names|| (c.names=[],c.names.keys={});c.plotLinesAndBandsGroups={};c.positiveValuesOnly=!(!c.logarithmic||e.allowNegativeLog);c.isLinked=J(e.linkedTo);c.ticks={};c.labelEdge=[];c.minorTicks={};c.plotLinesAndBands=[];c.alternateBands={};c.len=0;c.minRange=c.userMinRange=e.minRange||e.maxZoom;c.range=e.range;c.offset=e.offset||0;c.max=null;c.min=null;c.crosshair=u(e.crosshair,w(d.options.tooltip.crosshairs)[a?0:1],!1);b=c.options.events;-1===d.axes.indexOf(c)&&(a?d.axes.splice(d.xAxis.length,0,c):d.axes.push(c), d[c.coll].push(c));c.series=c.series||[];d.inverted&&!c.isZAxis&&a&&"undefined"===typeof c.reversed&&(c.reversed=!0);c.labelRotation=c.options.labels.rotation;m(b,function(b,d){f(b)&&K(c,d,b)});t(this,"afterInit")};B.prototype.setOptions=function(d){this.options=e(B.defaultOptions,"yAxis"===this.coll&&B.defaultYAxisOptions,[B.defaultTopAxisOptions,B.defaultRightAxisOptions,B.defaultBottomAxisOptions,B.defaultLeftAxisOptions][this.side],e(C[this.coll],d));t(this,"afterSetOptions",{userOptions:d})}; B.prototype.defaultLabelFormatter=function(){var d=this.axis,b=this.value,a=d.chart.time,c=d.categories,e=this.dateTimeLabelFormat,f=C.lang,m=f.numericSymbols;f=f.numericSymbolMagnitude||1E3;var u=m&&m.length,p=d.options.labels.format;d=d.logarithmic?Math.abs(b):d.tickInterval;var h=this.chart,w=h.numberFormatter;if(p)var l=q(p,this,h);else if(c)l=b;else if(e)l=a.dateFormat(e,b);else if(u&&1E3<=d)for(;u--&&"undefined"===typeof l;)a=Math.pow(f,u+1),d>=a&&0===10*b%a&&null!==m[u]&&0!==b&&(l=w(b/a,-1)+ m[u]);"undefined"===typeof l&&(l=1E4<=Math.abs(b)?w(b,-1):w(b,-1,void 0,""));return l};B.prototype.getSeriesExtremes=function(){var d=this,b=d.chart,n;t(this,"getSeriesExtremes",null,function(){d.hasVisibleSeries=!1;d.dataMin=d.dataMax=d.threshold=null;d.softThreshold=!d.isXAxis;d.stacking&&d.stacking.buildStacks();d.series.forEach(function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var e=c.options,f=e.threshold;d.hasVisibleSeries=!0;d.positiveValuesOnly&&0>=f&&(f=null);if(d.isXAxis){if(e= c.xData,e.length){n=c.getXExtremes(e);var x=n.min;var m=n.max;a(x)||x instanceof Date||(e=e.filter(a),n=c.getXExtremes(e),x=n.min,m=n.max);e.length&&(d.dataMin=Math.min(u(d.dataMin,x),x),d.dataMax=Math.max(u(d.dataMax,m),m))}}else if(c=c.applyExtremes(),a(c.dataMin)&&(x=c.dataMin,d.dataMin=Math.min(u(d.dataMin,x),x)),a(c.dataMax)&&(m=c.dataMax,d.dataMax=Math.max(u(d.dataMax,m),m)),J(f)&&(d.threshold=f),!e.softThreshold||d.positiveValuesOnly)d.softThreshold=!1}})});t(this,"afterGetSeriesExtremes")}; B.prototype.translate=function(d,b,n,c,e,f){var x=this.linkedParent||this,m=1,u=0,p=c?x.oldTransA:x.transA;c=c?x.oldMin:x.min;var h=x.minPixelPadding;e=(x.isOrdinal||x.brokenAxis&&x.brokenAxis.hasBreaks||x.logarithmic&&e)&&x.lin2val;p||(p=x.transA);n&&(m*=-1,u=x.len);x.reversed&&(m*=-1,u-=m*(x.sector||x.len));b?(d=(d*m+u-h)/p+c,e&&(d=x.lin2val(d))):(e&&(d=x.val2lin(d)),d=a(c)?m*(d-c)*p+u+m*h+(a(f)?p*f:0):void 0);return d};B.prototype.toPixels=function(d,b){return this.translate(d,!1,!this.horiz,null, !0)+(b?0:this.pos)};B.prototype.toValue=function(d,b){return this.translate(d-(b?0:this.pos),!0,!this.horiz,null,!0)};B.prototype.getPlotLinePath=function(d){function b(b,d,a){if("pass"!==l&&b<d||b>a)l?b=y(b,d,a):q=!0;return b}var n=this,c=n.chart,e=n.left,f=n.top,m=d.old,p=d.value,h=d.translatedValue,w=d.lineWidth,l=d.force,C,F,B,L,r=m&&c.oldChartHeight||c.chartHeight,O=m&&c.oldChartWidth||c.chartWidth,q,z=n.transB;d={value:p,lineWidth:w,old:m,force:l,acrossPanes:d.acrossPanes,translatedValue:h}; t(this,"getPlotLinePath",d,function(d){h=u(h,n.translate(p,null,null,m));h=y(h,-1E5,1E5);C=B=Math.round(h+z);F=L=Math.round(r-h-z);a(h)?n.horiz?(F=f,L=r-n.bottom,C=B=b(C,e,e+n.width)):(C=e,B=O-n.right,F=L=b(F,f,f+n.height)):(q=!0,l=!1);d.path=q&&!l?null:c.renderer.crispLine([["M",C,F],["L",B,L]],w||1)});return d.path};B.prototype.getLinearTickPositions=function(d,b,a){var n=I(Math.floor(b/d)*d);a=I(Math.ceil(a/d)*d);var c=[],e;I(n+d)===n&&(e=20);if(this.single)return[b];for(b=n;b<=a;){c.push(b);b= I(b+d,e);if(b===f)break;var f=b}return c};B.prototype.getMinorTickInterval=function(){var d=this.options;return!0===d.minorTicks?u(d.minorTickInterval,"auto"):!1===d.minorTicks?null:d.minorTickInterval};B.prototype.getMinorTickPositions=function(){var d=this.options,b=this.tickPositions,a=this.minorTickInterval,c=[],e=this.pointRangePadding||0,f=this.min-e;e=this.max+e;var m=e-f;if(m&&m/a<this.len/3){var u=this.logarithmic;if(u)this.paddedTicks.forEach(function(b,d,n){d&&c.push.apply(c,u.getLogTickPositions(a, n[d-1],n[d],!0))});else if(this.dateTime&&"auto"===this.getMinorTickInterval())c=c.concat(this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(a),f,e,d.startOfWeek));else for(d=f+(b[0]-f)%a;d<=e&&d!==c[0];d+=a)c.push(d)}0!==c.length&&this.trimTicks(c);return c};B.prototype.adjustForMinRange=function(){var d=this.options,b=this.min,a=this.max,c=this.logarithmic,e,f,m,p,h;this.isXAxis&&"undefined"===typeof this.minRange&&!c&&(J(d.min)||J(d.max)?this.minRange=null:(this.series.forEach(function(b){p= b.xData;for(f=h=b.xIncrement?1:p.length-1;0<f;f--)if(m=p[f]-p[f-1],"undefined"===typeof e||m<e)e=m}),this.minRange=Math.min(5*e,this.dataMax-this.dataMin)));if(a-b<this.minRange){var w=this.dataMax-this.dataMin>=this.minRange;var l=this.minRange;var C=(l-a+b)/2;C=[b-C,u(d.min,b-C)];w&&(C[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin);b=N(C);a=[b+l,u(d.max,b+l)];w&&(a[2]=c?c.log2lin(this.dataMax):this.dataMax);a=M(a);a-b<l&&(C[0]=a-l,C[1]=u(d.min,a-l),b=N(C))}this.min=b;this.max= a};B.prototype.getClosest=function(){var d;this.categories?d=1:this.series.forEach(function(b){var a=b.closestPointRange,c=b.visible||!b.chart.options.chart.ignoreHiddenSeries;!b.noSharedTooltip&&J(a)&&c&&(d=J(d)?Math.min(d,a):a)});return d};B.prototype.nameToX=function(d){var b=h(this.categories),a=b?this.categories:this.names,c=d.options.x;d.series.requireSorting=!1;J(c)||(c=!1===this.options.uniqueNames?d.series.autoIncrement():b?a.indexOf(d.name):u(a.keys[d.name],-1));if(-1===c){if(!b)var e=a.length}else e= c;"undefined"!==typeof e&&(this.names[e]=d.name,this.names.keys[d.name]=e);return e};B.prototype.updateNames=function(){var d=this,b=this.names;0<b.length&&(Object.keys(b.keys).forEach(function(d){delete b.keys[d]}),b.length=0,this.minRange=this.userMinRange,(this.series||[]).forEach(function(b){b.xIncrement=null;if(!b.points||b.isDirtyData)d.max=Math.max(d.max,b.xData.length-1),b.processData(),b.generatePoints();b.data.forEach(function(a,c){if(a&&a.options&&"undefined"!==typeof a.name){var n=d.nameToX(a); "undefined"!==typeof n&&n!==a.x&&(a.x=n,b.xData[c]=n)}})}))};B.prototype.setAxisTranslation=function(d){var b=this,a=b.max-b.min,c=b.axisPointRange||0,e=0,f=0,m=b.linkedParent,p=!!b.categories,h=b.transA,w=b.isXAxis;if(w||p||c){var C=b.getClosest();m?(e=m.minPointOffset,f=m.pointRangePadding):b.series.forEach(function(d){var a=p?1:w?u(d.options.pointRange,C,0):b.axisPointRange||0,n=d.options.pointPlacement;c=Math.max(c,a);if(!b.single||p)d=d.is("xrange")?!w:w,e=Math.max(e,d&&l(n)?0:a/2),f=Math.max(f, d&&"on"===n?0:a)});m=b.ordinal&&b.ordinal.slope&&C?b.ordinal.slope/C:1;b.minPointOffset=e*=m;b.pointRangePadding=f*=m;b.pointRange=Math.min(c,b.single&&p?1:a);w&&(b.closestPointRange=C)}d&&(b.oldTransA=h);b.translationSlope=b.transA=h=b.staticScale||b.len/(a+f||1);b.transB=b.horiz?b.left:b.bottom;b.minPixelPadding=h*e;t(this,"afterSetAxisTranslation")};B.prototype.minFromRange=function(){return this.max-this.range};B.prototype.setTickInterval=function(d){var b=this,n=b.chart,e=b.logarithmic,f=b.options, m=b.isXAxis,p=b.isLinked,h=f.maxPadding,w=f.minPadding,l=f.tickInterval,C=f.tickPixelInterval,F=b.categories,B=a(b.threshold)?b.threshold:null,L=b.softThreshold;b.dateTime||F||p||this.getTickAmount();var O=u(b.userMin,f.min);var q=u(b.userMax,f.max);if(p){b.linkedParent=n[b.coll][f.linkedTo];var z=b.linkedParent.getExtremes();b.min=u(z.min,z.dataMin);b.max=u(z.max,z.dataMax);f.type!==b.linkedParent.options.type&&D(11,1,n)}else{if(!L&&J(B))if(b.dataMin>=B)z=B,w=0;else if(b.dataMax<=B){var g=B;h=0}b.min= u(O,z,b.dataMin);b.max=u(q,g,b.dataMax)}e&&(b.positiveValuesOnly&&!d&&0>=Math.min(b.min,u(b.dataMin,b.min))&&D(10,1,n),b.min=I(e.log2lin(b.min),16),b.max=I(e.log2lin(b.max),16));b.range&&J(b.max)&&(b.userMin=b.min=O=Math.max(b.dataMin,b.minFromRange()),b.userMax=q=b.max,b.range=null);t(b,"foundExtremes");b.beforePadding&&b.beforePadding();b.adjustForMinRange();!(F||b.axisPointRange||b.stacking&&b.stacking.usePercentage||p)&&J(b.min)&&J(b.max)&&(n=b.max-b.min)&&(!J(O)&&w&&(b.min-=n*w),!J(q)&&h&&(b.max+= n*h));a(b.userMin)||(a(f.softMin)&&f.softMin<b.min&&(b.min=O=f.softMin),a(f.floor)&&(b.min=Math.max(b.min,f.floor)));a(b.userMax)||(a(f.softMax)&&f.softMax>b.max&&(b.max=q=f.softMax),a(f.ceiling)&&(b.max=Math.min(b.max,f.ceiling)));L&&J(b.dataMin)&&(B=B||0,!J(O)&&b.min<B&&b.dataMin>=B?b.min=b.options.minRange?Math.min(B,b.max-b.minRange):B:!J(q)&&b.max>B&&b.dataMax<=B&&(b.max=b.options.minRange?Math.max(B,b.min+b.minRange):B));b.tickInterval=b.min===b.max||"undefined"===typeof b.min||"undefined"=== typeof b.max?1:p&&!l&&C===b.linkedParent.options.tickPixelInterval?l=b.linkedParent.tickInterval:u(l,this.tickAmount?(b.max-b.min)/Math.max(this.tickAmount-1,1):void 0,F?1:(b.max-b.min)*C/Math.max(b.len,C));m&&!d&&b.series.forEach(function(d){d.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();b.ordinal&&(b.tickInterval=b.ordinal.postProcessTickInterval(b.tickInterval));b.pointRange&&!l&&(b.tickInterval=Math.max(b.pointRange, b.tickInterval));d=u(f.minTickInterval,b.dateTime&&b.closestPointRange);!l&&b.tickInterval<d&&(b.tickInterval=d);b.dateTime||b.logarithmic||l||(b.tickInterval=c(b.tickInterval,void 0,r(b.tickInterval),u(f.allowDecimals,.5>b.tickInterval||void 0!==this.tickAmount),!!this.tickAmount));this.tickAmount||(b.tickInterval=b.unsquish());this.setTickPositions()};B.prototype.setTickPositions=function(){var d=this.options,b=d.tickPositions;var a=this.getMinorTickInterval();var c=d.tickPositioner,e=this.hasVerticalPanning(), f="colorAxis"===this.coll,m=(f||!e)&&d.startOnTick;e=(f||!e)&&d.endOnTick;this.tickmarkOffset=this.categories&&"between"===d.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===a&&this.tickInterval?this.tickInterval/5:a;this.single=this.min===this.max&&J(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==d.allowDecimals);this.tickPositions=a=b&&b.slice();!a&&(this.ordinal&&this.ordinal.positions||!((this.max-this.min)/this.tickInterval>Math.max(2*this.len, 200))?a=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,d.units),this.min,this.max,d.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(a=[this.min,this.max],D(19,!1,this.chart)),a.length>this.len&&(a=[a[0],a.pop()],a[0]===a[1]&&(a.length=1)),this.tickPositions=a,c&&(c=c.apply(this, [this.min,this.max])))&&(this.tickPositions=a=c);this.paddedTicks=a.slice(0);this.trimTicks(a,m,e);this.isLinked||(this.single&&2>a.length&&!this.categories&&!this.series.some(function(b){return b.is("heatmap")&&"between"===b.options.pointPlacement})&&(this.min-=.5,this.max+=.5),b||c||this.adjustTickAmount());t(this,"afterSetTickPositions")};B.prototype.trimTicks=function(d,b,a){var c=d[0],n=d[d.length-1],e=!this.isOrdinal&&this.minPointOffset||0;t(this,"trimTicks");if(!this.isLinked){if(b&&-Infinity!== c)this.min=c;else for(;this.min-e>d[0];)d.shift();if(a)this.max=n;else for(;this.max+e<d[d.length-1];)d.pop();0===d.length&&J(c)&&!this.options.tickPositions&&d.push((n+c)/2)}};B.prototype.alignToOthers=function(){var d={},b,a=this.options;!1===this.chart.options.chart.alignTicks||!1===a.alignTicks||!1===a.startOnTick||!1===a.endOnTick||this.logarithmic||this.chart[this.coll].forEach(function(a){var c=a.options;c=[a.horiz?c.left:c.top,c.width,c.height,c.pane].join();a.series.length&&(d[c]?b=!0:d[c]= 1)});return b};B.prototype.getTickAmount=function(){var d=this.options,b=d.tickAmount,a=d.tickPixelInterval;!J(d.tickInterval)&&!b&&this.len<a&&!this.isRadial&&!this.logarithmic&&d.startOnTick&&d.endOnTick&&(b=2);!b&&this.alignToOthers()&&(b=Math.ceil(this.len/a)+1);4>b&&(this.finalTickAmt=b,b=5);this.tickAmount=b};B.prototype.adjustTickAmount=function(){var d=this.options,b=this.tickInterval,a=this.tickPositions,c=this.tickAmount,e=this.finalTickAmt,f=a&&a.length,m=u(this.threshold,this.softThreshold? 0:null),p;if(this.hasData()){if(f<c){for(p=this.min;a.length<c;)a.length%2||p===m?a.push(I(a[a.length-1]+b)):a.unshift(I(a[0]-b));this.transA*=(f-1)/(c-1);this.min=d.startOnTick?a[0]:Math.min(this.min,a[0]);this.max=d.endOnTick?a[a.length-1]:Math.max(this.max,a[a.length-1])}else f>c&&(this.tickInterval*=2,this.setTickPositions());if(J(e)){for(b=d=a.length;b--;)(3===e&&1===b%2||2>=e&&0<b&&b<d-1)&&a.splice(b,1);this.finalTickAmt=void 0}}};B.prototype.setScale=function(){var d,b=!1,a=!1;this.series.forEach(function(d){var c; b=b||d.isDirtyData||d.isDirty;a=a||(null===(c=d.xAxis)||void 0===c?void 0:c.isDirty)||!1});this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();(d=this.len!==this.oldAxisLength)||b||a||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?(this.stacking&&this.stacking.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax, this.isDirty||(this.isDirty=d||this.min!==this.oldMin||this.max!==this.oldMax)):this.stacking&&this.stacking.cleanStacks();b&&this.panningState&&(this.panningState.isDirty=!0);t(this,"afterSetScale")};B.prototype.setExtremes=function(d,b,a,c,e){var n=this,f=n.chart;a=u(a,!0);n.series.forEach(function(b){delete b.kdTree});e=z(e,{min:d,max:b});t(n,"setExtremes",e,function(){n.userMin=d;n.userMax=b;n.eventArgs=e;a&&f.redraw(c)})};B.prototype.zoom=function(d,b){var a=this,c=this.dataMin,e=this.dataMax, f=this.options,m=Math.min(c,u(f.min,c)),p=Math.max(e,u(f.max,e));d={newMin:d,newMax:b};t(this,"zoom",d,function(b){var d=b.newMin,n=b.newMax;if(d!==a.min||n!==a.max)a.allowZoomOutside||(J(c)&&(d<m&&(d=m),d>p&&(d=p)),J(e)&&(n<m&&(n=m),n>p&&(n=p))),a.displayBtn="undefined"!==typeof d||"undefined"!==typeof n,a.setExtremes(d,n,!1,void 0,{trigger:"zoom"});b.zoomed=!0});return d.zoomed};B.prototype.setAxisSize=function(){var d=this.chart,b=this.options,a=b.offsets||[0,0,0,0],c=this.horiz,e=this.width=Math.round(L(u(b.width, d.plotWidth-a[3]+a[1]),d.plotWidth)),f=this.height=Math.round(L(u(b.height,d.plotHeight-a[0]+a[2]),d.plotHeight)),m=this.top=Math.round(L(u(b.top,d.plotTop+a[0]),d.plotHeight,d.plotTop));b=this.left=Math.round(L(u(b.left,d.plotLeft+a[3]),d.plotWidth,d.plotLeft));this.bottom=d.chartHeight-f-m;this.right=d.chartWidth-e-b;this.len=Math.max(c?e:f,0);this.pos=c?b:m};B.prototype.getExtremes=function(){var d=this.logarithmic;return{min:d?I(d.lin2log(this.min)):this.min,max:d?I(d.lin2log(this.max)):this.max, dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}};B.prototype.getThreshold=function(d){var b=this.logarithmic,a=b?b.lin2log(this.min):this.min;b=b?b.lin2log(this.max):this.max;null===d||-Infinity===d?d=a:Infinity===d?d=b:a>d?d=a:b<d&&(d=b);return this.translate(d,0,1,0,1)};B.prototype.autoLabelAlign=function(d){var b=(u(d,0)-90*this.side+720)%360;d={align:"center"};t(this,"autoLabelAlign",d,function(d){15<b&&165>b?d.align="right":195<b&&345>b&&(d.align="left")}); return d.align};B.prototype.tickSize=function(d){var b=this.options,a=b["tick"===d?"tickLength":"minorTickLength"],c=u(b["tick"===d?"tickWidth":"minorTickWidth"],"tick"===d&&this.isXAxis&&!this.categories?1:0);if(c&&a){"inside"===b[d+"Position"]&&(a=-a);var e=[a,c]}d={tickSize:e};t(this,"afterTickSize",d);return d.tickSize};B.prototype.labelMetrics=function(){var d=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize, this.ticks[d]&&this.ticks[d].label)};B.prototype.unsquish=function(){var d=this.options.labels,b=this.horiz,a=this.tickInterval,c=a,e=this.len/(((this.categories?1:0)+this.max-this.min)/a),f,m=d.rotation,p=this.labelMetrics(),h,w=Number.MAX_VALUE,l,C=this.max-this.min,F=function(b){var d=b/(e||1);d=1<d?Math.ceil(d):1;d*a>C&&Infinity!==b&&Infinity!==e&&C&&(d=Math.ceil(C/a));return I(d*a)};b?(l=!d.staggerLines&&!d.step&&(J(m)?[m]:e<u(d.autoRotationLimit,80)&&d.autoRotation))&&l.forEach(function(b){if(b=== m||b&&-90<=b&&90>=b){h=F(Math.abs(p.h/Math.sin(O*b)));var d=h+Math.abs(b/360);d<w&&(w=d,f=b,c=h)}}):d.step||(c=F(p.h));this.autoRotation=l;this.labelRotation=u(f,m);return c};B.prototype.getSlotWidth=function(d){var b,c=this.chart,e=this.horiz,f=this.options.labels,m=Math.max(this.tickPositions.length-(this.categories?0:1),1),u=c.margin[3];if(d&&a(d.slotWidth))return d.slotWidth;if(e&&f&&2>(f.step||0))return f.rotation?0:(this.staggerLines||1)*this.len/m;if(!e){d=null===(b=null===f||void 0===f?void 0: f.style)||void 0===b?void 0:b.width;if(void 0!==d)return parseInt(d,10);if(u)return u-c.spacing[3]}return.33*c.chartWidth};B.prototype.renderUnsquish=function(){var d=this.chart,b=d.renderer,a=this.tickPositions,c=this.ticks,e=this.options.labels,f=e&&e.style||{},m=this.horiz,u=this.getSlotWidth(),p=Math.max(1,Math.round(u-2*(e.padding||5))),h={},w=this.labelMetrics(),C=e.style&&e.style.textOverflow,F=0;l(e.rotation)||(h.rotation=e.rotation||0);a.forEach(function(b){b=c[b];b.movedLabel&&b.replaceMovedLabel(); b&&b.label&&b.label.textPxLength>F&&(F=b.label.textPxLength)});this.maxLabelLength=F;if(this.autoRotation)F>p&&F>w.h?h.rotation=this.labelRotation:this.labelRotation=0;else if(u){var B=p;if(!C){var L="clip";for(p=a.length;!m&&p--;){var r=a[p];if(r=c[r].label)r.styles&&"ellipsis"===r.styles.textOverflow?r.css({textOverflow:"clip"}):r.textPxLength>u&&r.css({width:u+"px"}),r.getBBox().height>this.len/a.length-(w.h-w.f)&&(r.specificTextOverflow="ellipsis")}}}h.rotation&&(B=F>.5*d.chartHeight?.33*d.chartHeight: F,C||(L="ellipsis"));if(this.labelAlign=e.align||this.autoLabelAlign(this.labelRotation))h.align=this.labelAlign;a.forEach(function(b){var d=(b=c[b])&&b.label,a=f.width,e={};d&&(d.attr(h),b.shortenLabel?b.shortenLabel():B&&!a&&"nowrap"!==f.whiteSpace&&(B<d.textPxLength||"SPAN"===d.element.tagName)?(e.width=B+"px",C||(e.textOverflow=d.specificTextOverflow||L),d.css(e)):d.styles&&d.styles.width&&!e.width&&!a&&d.css({width:null}),delete d.specificTextOverflow,b.rotation=h.rotation)},this);this.tickRotCorr= b.rotCorr(w.b,this.labelRotation||0,0!==this.side)};B.prototype.hasData=function(){return this.series.some(function(d){return d.hasData()})||this.options.showEmpty&&J(this.min)&&J(this.max)};B.prototype.addTitle=function(d){var b=this.chart.renderer,a=this.horiz,c=this.opposite,f=this.options.title,m,u=this.chart.styledMode;this.axisTitle||((m=f.textAlign)||(m=(a?{low:"left",middle:"center",high:"right"}:{low:c?"right":"left",middle:"center",high:c?"left":"right"})[f.align]),this.axisTitle=b.text(f.text, 0,0,f.useHTML).attr({zIndex:7,rotation:f.rotation||0,align:m}).addClass("highcharts-axis-title"),u||this.axisTitle.css(e(f.style)),this.axisTitle.add(this.axisGroup),this.axisTitle.isNew=!0);u||f.style.width||this.isRadial||this.axisTitle.css({width:this.len+"px"});this.axisTitle[d?"show":"hide"](d)};B.prototype.generateTick=function(d){var b=this.ticks;b[d]?b[d].addLabel():b[d]=new H(this,d)};B.prototype.getOffset=function(){var d=this,b=d.chart,a=b.renderer,c=d.options,e=d.tickPositions,f=d.ticks, p=d.horiz,h=d.side,w=b.inverted&&!d.isZAxis?[1,0,3,2][h]:h,l,C=0,F=0,B=c.title,r=c.labels,L=0,O=b.axisOffset;b=b.clipOffset;var q=[-1,1,1,-1][h],z=c.className,g=d.axisParent;var k=d.hasData();d.showAxis=l=k||u(c.showEmpty,!0);d.staggerLines=d.horiz&&r.staggerLines;d.axisGroup||(d.gridGroup=a.g("grid").attr({zIndex:c.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(z||"")).add(g),d.axisGroup=a.g("axis").attr({zIndex:c.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+ " "+(z||"")).add(g),d.labelGroup=a.g("axis-labels").attr({zIndex:r.zIndex||7}).addClass("highcharts-"+d.coll.toLowerCase()+"-labels "+(z||"")).add(g));k||d.isLinked?(e.forEach(function(b,a){d.generateTick(b,a)}),d.renderUnsquish(),d.reserveSpaceDefault=0===h||2===h||{1:"left",3:"right"}[h]===d.labelAlign,u(r.reserveSpace,"center"===d.labelAlign?!0:null,d.reserveSpaceDefault)&&e.forEach(function(b){L=Math.max(f[b].getLabelSize(),L)}),d.staggerLines&&(L*=d.staggerLines),d.labelOffset=L*(d.opposite? -1:1)):m(f,function(b,d){b.destroy();delete f[d]});if(B&&B.text&&!1!==B.enabled&&(d.addTitle(l),l&&!1!==B.reserveSpace)){d.titleOffset=C=d.axisTitle.getBBox()[p?"height":"width"];var y=B.offset;F=J(y)?0:u(B.margin,p?5:10)}d.renderLine();d.offset=q*u(c.offset,O[h]?O[h]+(c.margin||0):0);d.tickRotCorr=d.tickRotCorr||{x:0,y:0};a=0===h?-d.labelMetrics().h:2===h?d.tickRotCorr.y:0;F=Math.abs(L)+F;L&&(F=F-a+q*(p?u(r.y,d.tickRotCorr.y+8*q):r.x));d.axisTitleMargin=u(y,F);d.getMaxLabelDimensions&&(d.maxLabelDimensions= d.getMaxLabelDimensions(f,e));p=this.tickSize("tick");O[h]=Math.max(O[h],d.axisTitleMargin+C+q*d.offset,F,e&&e.length&&p?p[0]+q*d.offset:0);c=c.offset?0:2*Math.floor(d.axisLine.strokeWidth()/2);b[w]=Math.max(b[w],c);t(this,"afterGetOffset")};B.prototype.getLinePath=function(d){var b=this.chart,a=this.opposite,c=this.offset,e=this.horiz,f=this.left+(a?this.width:0)+c;c=b.chartHeight-this.bottom-(a?this.height:0)+c;a&&(d*=-1);return b.renderer.crispLine([["M",e?this.left:f,e?c:this.top],["L",e?b.chartWidth- this.right:f,e?c:b.chartHeight-this.bottom]],d)};B.prototype.renderLine=function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.chart.styledMode||this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))};B.prototype.getTitlePosition=function(){var d=this.horiz,b=this.left,a=this.top,c=this.len,e=this.options.title,f=d?b:a,m=this.opposite,u=this.offset,p=e.x||0,h=e.y||0,w=this.axisTitle, l=this.chart.renderer.fontMetrics(e.style&&e.style.fontSize,w);w=Math.max(w.getBBox(null,0).height-l.h-1,0);c={low:f+(d?0:c),middle:f+c/2,high:f+(d?c:0)}[e.align];b=(d?a+this.height:b)+(d?1:-1)*(m?-1:1)*this.axisTitleMargin+[-w,w,l.f,-w][this.side];d={x:d?c+p:b+(m?this.width:0)+u+p,y:d?b+h-(m?this.height:0)+u:c+h};t(this,"afterGetTitlePosition",{titlePosition:d});return d};B.prototype.renderMinorTick=function(d){var b=this.chart.hasRendered&&a(this.oldMin),c=this.minorTicks;c[d]||(c[d]=new H(this, d,"minor"));b&&c[d].isNew&&c[d].render(null,!0);c[d].render(null,!1,1)};B.prototype.renderTick=function(d,b){var c=this.isLinked,e=this.ticks,f=this.chart.hasRendered&&a(this.oldMin);if(!c||d>=this.min&&d<=this.max)e[d]||(e[d]=new H(this,d)),f&&e[d].isNew&&e[d].render(b,!0,-1),e[d].render(b)};B.prototype.render=function(){var d=this,b=d.chart,c=d.logarithmic,e=d.options,f=d.isLinked,u=d.tickPositions,h=d.axisTitle,w=d.ticks,l=d.minorTicks,C=d.alternateBands,F=e.stackLabels,B=e.alternateGridColor, L=d.tickmarkOffset,r=d.axisLine,O=d.showAxis,q=G(b.renderer.globalAnimation),z,k;d.labelEdge.length=0;d.overlap=!1;[w,l,C].forEach(function(b){m(b,function(b){b.isActive=!1})});if(d.hasData()||f)d.minorTickInterval&&!d.categories&&d.getMinorTickPositions().forEach(function(b){d.renderMinorTick(b)}),u.length&&(u.forEach(function(b,a){d.renderTick(b,a)}),L&&(0===d.min||d.single)&&(w[-1]||(w[-1]=new H(d,-1,null,!0)),w[-1].render(-1))),B&&u.forEach(function(a,e){k="undefined"!==typeof u[e+1]?u[e+1]+L: d.max-L;0===e%2&&a<d.max&&k<=d.max+(b.polar?-L:L)&&(C[a]||(C[a]=new g.PlotLineOrBand(d)),z=a+L,C[a].options={from:c?c.lin2log(z):z,to:c?c.lin2log(k):k,color:B},C[a].render(),C[a].isActive=!0)}),d._addedPlotLB||((e.plotLines||[]).concat(e.plotBands||[]).forEach(function(b){d.addPlotBandOrLine(b)}),d._addedPlotLB=!0);[w,l,C].forEach(function(d){var a,c=[],e=q.duration;m(d,function(b,d){b.isActive||(b.render(d,!1,0),b.isActive=!1,c.push(d))});p(function(){for(a=c.length;a--;)d[c[a]]&&!d[c[a]].isActive&& (d[c[a]].destroy(),delete d[c[a]])},d!==C&&b.hasRendered&&e?e:0)});r&&(r[r.isPlaced?"animate":"attr"]({d:this.getLinePath(r.strokeWidth())}),r.isPlaced=!0,r[O?"show":"hide"](O));h&&O&&(e=d.getTitlePosition(),a(e.y)?(h[h.isNew?"attr":"animate"](e),h.isNew=!1):(h.attr("y",-9999),h.isNew=!0));F&&F.enabled&&d.stacking&&d.stacking.renderStackTotals();d.isDirty=!1;t(this,"afterRender")};B.prototype.redraw=function(){this.visible&&(this.render(),this.plotLinesAndBands.forEach(function(d){d.render()}));this.series.forEach(function(d){d.isDirty= !0})};B.prototype.getKeepProps=function(){return this.keepProps||B.keepProps};B.prototype.destroy=function(d){var b=this,a=b.plotLinesAndBands,c;t(this,"destroy",{keepEvents:d});d||F(b);[b.ticks,b.minorTicks,b.alternateBands].forEach(function(b){E(b)});if(a)for(d=a.length;d--;)a[d].destroy();"axisLine axisTitle axisGroup gridGroup labelGroup cross scrollbar".split(" ").forEach(function(d){b[d]&&(b[d]=b[d].destroy())});for(c in b.plotLinesAndBandsGroups)b.plotLinesAndBandsGroups[c]=b.plotLinesAndBandsGroups[c].destroy(); m(b,function(d,a){-1===b.getKeepProps().indexOf(a)&&delete b[a]})};B.prototype.drawCrosshair=function(d,b){var a=this.crosshair,c=u(a.snap,!0),e,f=this.cross,m=this.chart;t(this,"drawCrosshair",{e:d,point:b});d||(d=this.cross&&this.cross.e);if(this.crosshair&&!1!==(J(b)||!c)){c?J(b)&&(e=u("colorAxis"!==this.coll?b.crosshairPos:null,this.isXAxis?b.plotX:this.len-b.plotY)):e=d&&(this.horiz?d.chartX-this.pos:this.len-d.chartY+this.pos);if(J(e)){var p={value:b&&(this.isXAxis?b.x:u(b.stackY,b.y)),translatedValue:e}; m.polar&&z(p,{isCrosshair:!0,chartX:d&&d.chartX,chartY:d&&d.chartY,point:b});p=this.getPlotLinePath(p)||null}if(!J(p)){this.hideCrosshair();return}c=this.categories&&!this.isRadial;f||(this.cross=f=m.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+(c?"category ":"thin ")+a.className).attr({zIndex:u(a.zIndex,2)}).add(),m.styledMode||(f.attr({stroke:a.color||(c?k.parse("#ccd6eb").setOpacity(.25).get():"#cccccc"),"stroke-width":u(a.width,1)}).css({"pointer-events":"none"}),a.dashStyle&& f.attr({dashstyle:a.dashStyle})));f.show().attr({d:p});c&&!a.width&&f.attr({"stroke-width":this.transA});this.cross.e=d}else this.hideCrosshair();t(this,"afterDrawCrosshair",{e:d,point:b})};B.prototype.hideCrosshair=function(){this.cross&&this.cross.hide();t(this,"afterHideCrosshair")};B.prototype.hasVerticalPanning=function(){var d,b;return/y/.test((null===(b=null===(d=this.chart.options.chart)||void 0===d?void 0:d.panning)||void 0===b?void 0:b.type)||"")};B.defaultOptions={dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L", range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,labels:{enabled:!0,indentation:10,x:0,style:{color:"#666666",cursor:"default",fontSize:"11px"}},maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",minPadding:.01,showEmpty:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle", style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"};B.defaultYAxisOptions={endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){var d=this.axis.chart.numberFormatter;return d(this.total, -1)},style:{color:"#000000",fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0};B.defaultLeftAxisOptions={labels:{x:-15},title:{rotation:270}};B.defaultRightAxisOptions={labels:{x:15},title:{rotation:90}};B.defaultBottomAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}};B.defaultTopAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}};B.keepProps="extKey hcEvents names series userMax userMin".split(" ");return B}(); g.Axis=v;return g.Axis});P(A,"parts/DateTimeAxis.js",[A["parts/Axis.js"],A["parts/Utilities.js"]],function(k,g){var H=g.addEvent,v=g.getMagnitude,K=g.normalizeTickInterval,G=g.timeUnits,N=function(){function g(g){this.axis=g}g.prototype.normalizeTimeTickInterval=function(g,k){var y=k||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]];k=y[y.length-1];var E= G[k[0]],D=k[1],z;for(z=0;z<y.length&&!(k=y[z],E=G[k[0]],D=k[1],y[z+1]&&g<=(E*D[D.length-1]+G[y[z+1][0]])/2);z++);E===G.year&&g<5*E&&(D=[1,2,5]);g=K(g/E,D,"year"===k[0]?Math.max(v(g/E),1):1);return{unitRange:E,count:g,unitName:k[0]}};return g}();g=function(){function g(){}g.compose=function(g){g.keepProps.push("dateTime");g.prototype.getTimeTicks=function(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)};H(g,"init",function(g){"datetime"!==g.userOptions.type?this.dateTime=void 0: this.dateTime||(this.dateTime=new N(this))})};g.AdditionsClass=N;return g}();g.compose(k);return g});P(A,"parts/LogarithmicAxis.js",[A["parts/Axis.js"],A["parts/Utilities.js"]],function(k,g){var H=g.addEvent,v=g.getMagnitude,K=g.normalizeTickInterval,G=g.pick,N=function(){function g(g){this.axis=g}g.prototype.getLogTickPositions=function(g,k,J,E){var y=this.axis,z=y.len,t=y.options,q=[];E||(this.minorAutoInterval=void 0);if(.5<=g)g=Math.round(g),q=y.getLinearTickPositions(g,k,J);else if(.08<=g){t= Math.floor(k);var r,h;for(z=.3<g?[1,2,4]:.15<g?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];t<J+1&&!h;t++){var f=z.length;for(r=0;r<f&&!h;r++){var a=this.log2lin(this.lin2log(t)*z[r]);a>k&&(!E||l<=J)&&"undefined"!==typeof l&&q.push(l);l>J&&(h=!0);var l=a}}}else k=this.lin2log(k),J=this.lin2log(J),g=E?y.getMinorTickInterval():t.tickInterval,g=G("auto"===g?null:g,this.minorAutoInterval,t.tickPixelInterval/(E?5:1)*(J-k)/((E?z/y.tickPositions.length:z)||1)),g=K(g,void 0,v(g)),q=y.getLinearTickPositions(g,k,J).map(this.log2lin), E||(this.minorAutoInterval=g/5);E||(y.tickInterval=g);return q};g.prototype.lin2log=function(g){return Math.pow(10,g)};g.prototype.log2lin=function(g){return Math.log(g)/Math.LN10};return g}();g=function(){function g(){}g.compose=function(g){g.keepProps.push("logarithmic");var k=g.prototype,y=N.prototype;k.log2lin=y.log2lin;k.lin2log=y.lin2log;H(g,"init",function(g){var k=this.logarithmic;"logarithmic"!==g.userOptions.type?this.logarithmic=void 0:(k||(k=this.logarithmic=new N(this)),this.log2lin!== k.log2lin&&(k.log2lin=this.log2lin.bind(this)),this.lin2log!==k.lin2log&&(k.lin2log=this.lin2log.bind(this)))});H(g,"afterInit",function(){var g=this.logarithmic;g&&(this.lin2val=function(k){return g.lin2log(k)},this.val2lin=function(k){return g.log2lin(k)})})};return g}();g.compose(k);return g});P(A,"parts/PlotLineOrBand.js",[A["parts/Globals.js"],A["parts/Axis.js"],A["parts/Utilities.js"]],function(k,g,H){var v=H.arrayMax,K=H.arrayMin,G=H.defined,N=H.destroyObjectProperties,M=H.erase,y=H.extend, I=H.merge,J=H.objectEach,E=H.pick,D=function(){function g(t,q){this.axis=t;q&&(this.options=q,this.id=q.id)}g.prototype.render=function(){k.fireEvent(this,"render");var t=this,q=t.axis,r=q.horiz,h=q.logarithmic,f=t.options,a=f.label,l=t.label,e=f.to,c=f.from,m=f.value,u=G(c)&&G(e),L=G(m),F=t.svgElem,w=!F,p=[],C=f.color,O=E(f.zIndex,0),B=f.events;p={"class":"highcharts-plot-"+(u?"band ":"line ")+(f.className||"")};var d={},b=q.chart.renderer,n=u?"bands":"lines";h&&(c=h.log2lin(c),e=h.log2lin(e),m= h.log2lin(m));q.chart.styledMode||(L?(p.stroke=C||"#999999",p["stroke-width"]=E(f.width,1),f.dashStyle&&(p.dashstyle=f.dashStyle)):u&&(p.fill=C||"#e6ebf5",f.borderWidth&&(p.stroke=f.borderColor,p["stroke-width"]=f.borderWidth)));d.zIndex=O;n+="-"+O;(h=q.plotLinesAndBandsGroups[n])||(q.plotLinesAndBandsGroups[n]=h=b.g("plot-"+n).attr(d).add());w&&(t.svgElem=F=b.path().attr(p).add(h));if(L)p=q.getPlotLinePath({value:m,lineWidth:F.strokeWidth(),acrossPanes:f.acrossPanes});else if(u)p=q.getPlotBandPath(c, e,f);else return;(w||!F.d)&&p&&p.length?(F.attr({d:p}),B&&J(B,function(b,d){F.on(d,function(b){B[d].apply(t,[b])})})):F&&(p?(F.show(!0),F.animate({d:p})):F.d&&(F.hide(),l&&(t.label=l=l.destroy())));a&&(G(a.text)||G(a.formatter))&&p&&p.length&&0<q.width&&0<q.height&&!p.isFlat?(a=I({align:r&&u&&"center",x:r?!u&&4:10,verticalAlign:!r&&u&&"middle",y:r?u?16:10:u?6:-4,rotation:r&&!u&&90},a),this.renderLabel(a,p,u,O)):l&&l.hide();return t};g.prototype.renderLabel=function(t,q,r,h){var f=this.label,a=this.axis.chart.renderer; f||(f={align:t.textAlign||t.align,rotation:t.rotation,"class":"highcharts-plot-"+(r?"band":"line")+"-label "+(t.className||"")},f.zIndex=h,h=this.getLabelText(t),this.label=f=a.text(h,0,0,t.useHTML).attr(f).add(),this.axis.chart.styledMode||f.css(t.style));a=q.xBounds||[q[0][1],q[1][1],r?q[2][1]:q[0][1]];q=q.yBounds||[q[0][2],q[1][2],r?q[2][2]:q[0][2]];r=K(a);h=K(q);f.align(t,!1,{x:r,y:h,width:v(a)-r,height:v(q)-h});f.show(!0)};g.prototype.getLabelText=function(t){return G(t.formatter)?t.formatter.call(this): t.text};g.prototype.destroy=function(){M(this.axis.plotLinesAndBands,this);delete this.axis;N(this)};return g}();y(g.prototype,{getPlotBandPath:function(g,t){var q=this.getPlotLinePath({value:t,force:!0,acrossPanes:this.options.acrossPanes}),r=this.getPlotLinePath({value:g,force:!0,acrossPanes:this.options.acrossPanes}),h=[],f=this.horiz,a=1;g=g<this.min&&t<this.min||g>this.max&&t>this.max;if(r&&q){if(g){var l=r.toString()===q.toString();a=0}for(g=0;g<r.length;g+=2){t=r[g];var e=r[g+1],c=q[g],m=q[g+ 1];"M"!==t[0]&&"L"!==t[0]||"M"!==e[0]&&"L"!==e[0]||"M"!==c[0]&&"L"!==c[0]||"M"!==m[0]&&"L"!==m[0]||(f&&c[1]===t[1]?(c[1]+=a,m[1]+=a):f||c[2]!==t[2]||(c[2]+=a,m[2]+=a),h.push(["M",t[1],t[2]],["L",e[1],e[2]],["L",m[1],m[2]],["L",c[1],c[2]],["Z"]));h.isFlat=l}}return h},addPlotBand:function(g){return this.addPlotBandOrLine(g,"plotBands")},addPlotLine:function(g){return this.addPlotBandOrLine(g,"plotLines")},addPlotBandOrLine:function(g,t){var q=(new D(this,g)).render(),r=this.userOptions;if(q){if(t){var h= r[t]||[];h.push(g);r[t]=h}this.plotLinesAndBands.push(q)}return q},removePlotBandOrLine:function(g){for(var t=this.plotLinesAndBands,q=this.options,r=this.userOptions,h=t.length;h--;)t[h].id===g&&t[h].destroy();[q.plotLines||[],r.plotLines||[],q.plotBands||[],r.plotBands||[]].forEach(function(f){for(h=f.length;h--;)(f[h]||{}).id===g&&M(f,f[h])})},removePlotBand:function(g){this.removePlotBandOrLine(g)},removePlotLine:function(g){this.removePlotBandOrLine(g)}});k.PlotLineOrBand=D;return k.PlotLineOrBand}); P(A,"parts/Tooltip.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.clamp,v=g.css,K=g.defined,G=g.discardElement,N=g.extend,M=g.fireEvent,y=g.format,I=g.isNumber,J=g.isString,E=g.merge,D=g.pick,z=g.splat,t=g.syncTimeout,q=g.timeUnits;"";var r=k.doc,h=function(){function f(a,f){this.crosshairs=[];this.distance=0;this.isHidden=!0;this.isSticky=!1;this.now={};this.options={};this.outside=!1;this.chart=a;this.init(a,f)}f.prototype.applyFilter=function(){var a=this.chart;a.renderer.definition({tagName:"filter", id:"drop-shadow-"+a.index,opacity:.5,children:[{tagName:"feGaussianBlur","in":"SourceAlpha",stdDeviation:1},{tagName:"feOffset",dx:1,dy:1},{tagName:"feComponentTransfer",children:[{tagName:"feFuncA",type:"linear",slope:.3}]},{tagName:"feMerge",children:[{tagName:"feMergeNode"},{tagName:"feMergeNode","in":"SourceGraphic"}]}]});a.renderer.definition({tagName:"style",textContent:".highcharts-tooltip-"+a.index+"{filter:url(#drop-shadow-"+a.index+")}"})};f.prototype.bodyFormatter=function(a){return a.map(function(a){var e= a.series.tooltipOptions;return(e[(a.point.formatPrefix||"point")+"Formatter"]||a.point.tooltipFormatter).call(a.point,e[(a.point.formatPrefix||"point")+"Format"]||"")})};f.prototype.cleanSplit=function(a){this.chart.series.forEach(function(f){var e=f&&f.tt;e&&(!e.isActive||a?f.tt=e.destroy():e.isActive=!1)})};f.prototype.defaultFormatter=function(a){var f=this.points||z(this);var e=[a.tooltipFooterHeaderFormatter(f[0])];e=e.concat(a.bodyFormatter(f));e.push(a.tooltipFooterHeaderFormatter(f[0],!0)); return e};f.prototype.destroy=function(){this.label&&(this.label=this.label.destroy());this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy());this.renderer&&(this.renderer=this.renderer.destroy(),G(this.container));g.clearTimeout(this.hideTimer);g.clearTimeout(this.tooltipTimeout)};f.prototype.getAnchor=function(a,f){var e=this.chart,c=e.pointer,m=e.inverted,u=e.plotTop,h=e.plotLeft,l=0,w=0,p,C;a=z(a);this.followPointer&&f?("undefined"===typeof f.chartX&&(f=c.normalize(f)), a=[f.chartX-h,f.chartY-u]):a[0].tooltipPos?a=a[0].tooltipPos:(a.forEach(function(a){p=a.series.yAxis;C=a.series.xAxis;l+=a.plotX+(!m&&C?C.left-h:0);w+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!m&&p?p.top-u:0)}),l/=a.length,w/=a.length,a=[m?e.plotWidth-w:l,this.shared&&!m&&1<a.length&&f?f.chartY-u:m?e.plotHeight-l:w]);return a.map(Math.round)};f.prototype.getDateFormat=function(a,f,e,c){var m=this.chart.time,u=m.dateFormat("%m-%d %H:%M:%S.%L",f),h={millisecond:15,second:12,minute:9,hour:6,day:3}, l="millisecond";for(w in q){if(a===q.week&&+m.dateFormat("%w",f)===e&&"00:00:00.000"===u.substr(6)){var w="week";break}if(q[w]>a){w=l;break}if(h[w]&&u.substr(h[w])!=="01-01 00:00:00.000".substr(h[w]))break;"week"!==w&&(l=w)}if(w)var p=m.resolveDTLFormat(c[w]).main;return p};f.prototype.getLabel=function(){var a,f,e=this,c=this.chart.renderer,m=this.chart.styledMode,u=this.options,h="tooltip"+(K(u.className)?" "+u.className:""),F=(null===(a=u.style)||void 0===a?void 0:a.pointerEvents)||(!this.followPointer&& u.stickOnContact?"auto":"none"),w;a=function(){e.inContact=!0};var p=function(){var a=e.chart.hoverSeries;e.inContact=!1;if(a&&a.onMouseOut)a.onMouseOut()};if(!this.label){this.outside&&(this.container=w=k.doc.createElement("div"),w.className="highcharts-tooltip-container",v(w,{position:"absolute",top:"1px",pointerEvents:F,zIndex:3}),k.doc.body.appendChild(w),this.renderer=c=new k.Renderer(w,0,0,null===(f=this.chart.options.chart)||void 0===f?void 0:f.style,void 0,void 0,c.styledMode));this.split? this.label=c.g(h):(this.label=c.label("",0,0,u.shape||"callout",null,null,u.useHTML,null,h).attr({padding:u.padding,r:u.borderRadius}),m||this.label.attr({fill:u.backgroundColor,"stroke-width":u.borderWidth}).css(u.style).css({pointerEvents:F}).shadow(u.shadow));m&&(this.applyFilter(),this.label.addClass("highcharts-tooltip-"+this.chart.index));if(e.outside&&!e.split){var C={x:this.label.xSetter,y:this.label.ySetter};this.label.xSetter=function(a,c){C[c].call(this.label,e.distance);w.style.left=a+ "px"};this.label.ySetter=function(a,c){C[c].call(this.label,e.distance);w.style.top=a+"px"}}this.label.on("mouseenter",a).on("mouseleave",p).attr({zIndex:8}).add()}return this.label};f.prototype.getPosition=function(a,f,e){var c=this.chart,m=this.distance,u={},h=c.inverted&&e.h||0,l,w=this.outside,p=w?r.documentElement.clientWidth-2*m:c.chartWidth,C=w?Math.max(r.body.scrollHeight,r.documentElement.scrollHeight,r.body.offsetHeight,r.documentElement.offsetHeight,r.documentElement.clientHeight):c.chartHeight, t=c.pointer.getChartPosition(),B=c.containerScaling,d=function(b){return B?b*B.scaleX:b},b=function(b){return B?b*B.scaleY:b},n=function(n){var u="x"===n;return[n,u?p:C,u?a:f].concat(w?[u?d(a):b(f),u?t.left-m+d(e.plotX+c.plotLeft):t.top-m+b(e.plotY+c.plotTop),0,u?p:C]:[u?a:f,u?e.plotX+c.plotLeft:e.plotY+c.plotTop,u?c.plotLeft:c.plotTop,u?c.plotLeft+c.plotWidth:c.plotTop+c.plotHeight])},x=n("y"),q=n("x"),g=!this.followPointer&&D(e.ttBelow,!c.inverted===!!e.negative),z=function(a,c,e,f,n,p,w){var x= "y"===a?b(m):d(m),l=(e-f)/2,C=f<n-m,F=n+m+f<c,B=n-x-e+l;n=n+x-l;if(g&&F)u[a]=n;else if(!g&&C)u[a]=B;else if(C)u[a]=Math.min(w-f,0>B-h?B:B-h);else if(F)u[a]=Math.max(p,n+h+e>c?n:n+h);else return!1},k=function(b,d,a,c,e){var f;e<m||e>d-m?f=!1:u[b]=e<a/2?1:e>d-c/2?d-c-2:e-a/2;return f},y=function(b){var d=x;x=q;q=d;l=b},E=function(){!1!==z.apply(0,x)?!1!==k.apply(0,q)||l||(y(!0),E()):l?u.x=u.y=0:(y(!0),E())};(c.inverted||1<this.len)&&y();E();return u};f.prototype.getXDateFormat=function(a,f,e){f=f.dateTimeLabelFormats; var c=e&&e.closestPointRange;return(c?this.getDateFormat(c,a.x,e.options.startOfWeek,f):f.day)||f.year};f.prototype.hide=function(a){var f=this;g.clearTimeout(this.hideTimer);a=D(a,this.options.hideDelay,500);this.isHidden||(this.hideTimer=t(function(){f.getLabel().fadeOut(a?void 0:a);f.isHidden=!0},a))};f.prototype.init=function(a,f){this.chart=a;this.options=f;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=f.split&&!a.inverted&&!a.polar;this.shared=f.shared||this.split;this.outside= D(f.outside,!(!a.scrollablePixelsX&&!a.scrollablePixelsY))};f.prototype.isStickyOnContact=function(){return!(this.followPointer||!this.options.stickOnContact||!this.inContact)};f.prototype.move=function(a,f,e,c){var m=this,u=m.now,h=!1!==m.options.animation&&!m.isHidden&&(1<Math.abs(a-u.x)||1<Math.abs(f-u.y)),l=m.followPointer||1<m.len;N(u,{x:h?(2*u.x+a)/3:a,y:h?(u.y+f)/2:f,anchorX:l?void 0:h?(2*u.anchorX+e)/3:e,anchorY:l?void 0:h?(u.anchorY+c)/2:c});m.getLabel().attr(u);m.drawTracker();h&&(g.clearTimeout(this.tooltipTimeout), this.tooltipTimeout=setTimeout(function(){m&&m.move(a,f,e,c)},32))};f.prototype.refresh=function(a,f){var e=this.chart,c=this.options,m=a,u={},h=[],l=c.formatter||this.defaultFormatter;u=this.shared;var w=e.styledMode;if(c.enabled){g.clearTimeout(this.hideTimer);this.followPointer=z(m)[0].series.tooltipOptions.followPointer;var p=this.getAnchor(m,f);f=p[0];var C=p[1];!u||m.series&&m.series.noSharedTooltip?u=m.getLabelConfig():(e.pointer.applyInactiveState(m),m.forEach(function(a){a.setState("hover"); h.push(a.getLabelConfig())}),u={x:m[0].category,y:m[0].y},u.points=h,m=m[0]);this.len=h.length;e=l.call(u,this);l=m.series;this.distance=D(l.tooltipOptions.distance,16);!1===e?this.hide():(this.split?this.renderSplit(e,z(a)):(a=this.getLabel(),c.style.width&&!w||a.css({width:this.chart.spacingBox.width+"px"}),a.attr({text:e&&e.join?e.join(""):e}),a.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+D(m.colorIndex,l.colorIndex)),w||a.attr({stroke:c.borderColor||m.color||l.color||"#666666"}), this.updatePosition({plotX:f,plotY:C,negative:m.negative,ttBelow:m.ttBelow,h:p[2]||0})),this.isHidden&&this.label&&this.label.attr({opacity:1}).show(),this.isHidden=!1);M(this,"refresh")}};f.prototype.renderSplit=function(a,f){function e(b,d,a,c,e){void 0===e&&(e=!0);a?(d=y?0:I,b=H(b-c/2,g.left,g.right-c)):(d-=E,b=e?b-c-x:b+x,b=H(b,e?b:g.left,g.right));return{x:b,y:d}}var c=this,m=c.chart,u=c.chart,h=u.plotHeight,l=u.plotLeft,w=u.plotTop,p=u.pointer,C=u.renderer,r=u.scrollablePixelsY,B=void 0===r? 0:r;r=u.scrollingContainer;r=void 0===r?{scrollLeft:0,scrollTop:0}:r;var d=r.scrollLeft,b=r.scrollTop,n=u.styledMode,x=c.distance,q=c.options,t=c.options.positioner,g={left:d,right:d+u.chartWidth,top:b,bottom:b+u.chartHeight},z=c.getLabel(),y=!(!m.xAxis[0]||!m.xAxis[0].opposite),E=w+b,v=0,I=h-B;J(a)&&(a=[!1,a]);a=a.slice(0,f.length+1).reduce(function(d,a,m){if(!1!==a&&""!==a){m=f[m-1]||{isHeader:!0,plotX:f[0].plotX,plotY:h,series:{}};var u=m.isHeader,p=u?c:m.series,F=p.tt,r=m.isHeader;var L=m.series; var O="highcharts-color-"+D(m.colorIndex,L.colorIndex,"none");F||(F={padding:q.padding,r:q.borderRadius},n||(F.fill=q.backgroundColor,F["stroke-width"]=q.borderWidth),F=C.label("",0,0,q[r?"headerShape":"shape"]||"callout",void 0,void 0,q.useHTML).addClass((r?"highcharts-tooltip-header ":"")+"highcharts-tooltip-box "+O).attr(F).add(z));F.isActive=!0;F.attr({text:a});n||F.css(q.style).shadow(q.shadow).attr({stroke:q.borderColor||m.color||L.color||"#333333"});a=p.tt=F;r=a.getBBox();p=r.width+a.strokeWidth(); u&&(v=r.height,I+=v,y&&(E-=v));L=m.plotX;L=void 0===L?0:L;O=m.plotY;O=void 0===O?0:O;var k=m.series;if(m.isHeader){L=l+L;var Q=w+h/2}else F=k.xAxis,k=k.yAxis,L=F.pos+H(L,-x,F.len+x),k.pos+O>=b+w&&k.pos+O<=b+w+h-B&&(Q=k.pos+O);L=H(L,g.left-x,g.right+x);"number"===typeof Q?(r=r.height+1,O=t?t.call(c,p,r,m):e(L,Q,u,p),d.push({align:t?0:void 0,anchorX:L,anchorY:Q,boxWidth:p,point:m,rank:D(O.rank,u?1:0),size:r,target:O.y,tt:a,x:O.x})):a.isActive=!1}return d},[]);!t&&a.some(function(b){return b.x<g.left})&& (a=a.map(function(b){var d=e(b.anchorX,b.anchorY,b.point.isHeader,b.boxWidth,!1);return N(b,{target:d.y,x:d.x})}));c.cleanSplit();k.distribute(a,I);a.forEach(function(b){var d=b.pos;b.tt.attr({visibility:"undefined"===typeof d?"hidden":"inherit",x:b.x,y:d+E,anchorX:b.anchorX,anchorY:b.anchorY})});a=c.container;m=c.renderer;c.outside&&a&&m&&(u=z.getBBox(),m.setSize(u.width+u.x,u.height+u.y,!1),p=p.getChartPosition(),a.style.left=p.left+"px",a.style.top=p.top+"px")};f.prototype.drawTracker=function(){if(this.followPointer|| !this.options.stickOnContact)this.tracker&&this.tracker.destroy();else{var a=this.chart,f=this.label,e=a.hoverPoint;if(f&&e){var c={x:0,y:0,width:0,height:0};e=this.getAnchor(e);var m=f.getBBox();e[0]+=a.plotLeft-f.translateX;e[1]+=a.plotTop-f.translateY;c.x=Math.min(0,e[0]);c.y=Math.min(0,e[1]);c.width=0>e[0]?Math.max(Math.abs(e[0]),m.width-e[0]):Math.max(Math.abs(e[0]),m.width);c.height=0>e[1]?Math.max(Math.abs(e[1]),m.height-Math.abs(e[1])):Math.max(Math.abs(e[1]),m.height);this.tracker?this.tracker.attr(c): (this.tracker=f.renderer.rect(c).addClass("highcharts-tracker").add(f),a.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}};f.prototype.styledModeFormat=function(a){return a.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')};f.prototype.tooltipFooterHeaderFormatter=function(a,f){var e=f?"footer":"header",c=a.series,m=c.tooltipOptions,u=m.xDateFormat,h=c.xAxis,l=h&&"datetime"===h.options.type&& I(a.key),w=m[e+"Format"];f={isFooter:f,labelConfig:a};M(this,"headerFormatter",f,function(e){l&&!u&&(u=this.getXDateFormat(a,m,h));l&&u&&(a.point&&a.point.tooltipDateKeys||["key"]).forEach(function(a){w=w.replace("{point."+a+"}","{point."+a+":"+u+"}")});c.chart.styledMode&&(w=this.styledModeFormat(w));e.text=y(w,{point:a,series:c},this.chart)});return f.text};f.prototype.update=function(a){this.destroy();E(!0,this.chart.options.tooltip.userOptions,a);this.init(this.chart,E(!0,this.options,a))};f.prototype.updatePosition= function(a){var f=this.chart,e=f.pointer,c=this.getLabel(),m=a.plotX+f.plotLeft,u=a.plotY+f.plotTop;e=e.getChartPosition();a=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);if(this.outside){var h=(this.options.borderWidth||0)+2*this.distance;this.renderer.setSize(c.width+h,c.height+h,!1);if(f=f.containerScaling)v(this.container,{transform:"scale("+f.scaleX+", "+f.scaleY+")"}),m*=f.scaleX,u*=f.scaleY;m+=e.left-a.x;u+=e.top-a.y}this.move(Math.round(a.x),Math.round(a.y||0), m,u)};return f}();k.Tooltip=h;return k.Tooltip});P(A,"parts/Pointer.js",[A["parts/Globals.js"],A["parts/Utilities.js"],A["parts/Tooltip.js"],A["parts/Color.js"]],function(k,g,H,v){var K=g.addEvent,G=g.attr,N=g.css,M=g.defined,y=g.extend,I=g.find,J=g.fireEvent,E=g.isNumber,D=g.isObject,z=g.objectEach,t=g.offset,q=g.pick,r=g.splat,h=v.parse,f=k.charts,a=k.noop;g=function(){function l(a,c){this.lastValidTouch={};this.pinchDown=[];this.runChartClick=!1;this.chart=a;this.hasDragged=!1;this.options=c;this.unbindContainerMouseLeave= function(){};this.init(a,c)}l.prototype.applyInactiveState=function(a){var c=[],e;(a||[]).forEach(function(a){e=a.series;c.push(e);e.linkedParent&&c.push(e.linkedParent);e.linkedSeries&&(c=c.concat(e.linkedSeries));e.navigatorSeries&&c.push(e.navigatorSeries)});this.chart.series.forEach(function(a){-1===c.indexOf(a)?a.setState("inactive",!0):a.options.inactiveOtherPoints&&a.setAllPointsToState("inactive")})};l.prototype.destroy=function(){var a=this;"undefined"!==typeof a.unDocMouseMove&&a.unDocMouseMove(); this.unbindContainerMouseLeave();k.chartCount||(k.unbindDocumentMouseUp&&(k.unbindDocumentMouseUp=k.unbindDocumentMouseUp()),k.unbindDocumentTouchEnd&&(k.unbindDocumentTouchEnd=k.unbindDocumentTouchEnd()));clearInterval(a.tooltipTimeout);z(a,function(c,e){a[e]=null})};l.prototype.drag=function(a){var c=this.chart,e=c.options.chart,f=a.chartX,l=a.chartY,F=this.zoomHor,w=this.zoomVert,p=c.plotLeft,C=c.plotTop,r=c.plotWidth,B=c.plotHeight,d=this.selectionMarker,b=this.mouseDownX||0,n=this.mouseDownY|| 0,x=D(e.panning)?e.panning&&e.panning.enabled:e.panning,q=e.panKey&&a[e.panKey+"Key"];if(!d||!d.touch)if(f<p?f=p:f>p+r&&(f=p+r),l<C?l=C:l>C+B&&(l=C+B),this.hasDragged=Math.sqrt(Math.pow(b-f,2)+Math.pow(n-l,2)),10<this.hasDragged){var t=c.isInsidePlot(b-p,n-C);c.hasCartesianSeries&&(this.zoomX||this.zoomY)&&t&&!q&&!d&&(this.selectionMarker=d=c.renderer.rect(p,C,F?1:r,w?1:B,0).attr({"class":"highcharts-selection-marker",zIndex:7}).add(),c.styledMode||d.attr({fill:e.selectionMarkerFill||h("#335cad").setOpacity(.25).get()})); d&&F&&(f-=b,d.attr({width:Math.abs(f),x:(0<f?0:f)+b}));d&&w&&(f=l-n,d.attr({height:Math.abs(f),y:(0<f?0:f)+n}));t&&!d&&x&&c.pan(a,e.panning)}};l.prototype.dragStart=function(a){var c=this.chart;c.mouseIsDown=a.type;c.cancelClick=!1;c.mouseDownX=this.mouseDownX=a.chartX;c.mouseDownY=this.mouseDownY=a.chartY};l.prototype.drop=function(a){var c=this,e=this.chart,f=this.hasPinched;if(this.selectionMarker){var h={originalEvent:a,xAxis:[],yAxis:[]},l=this.selectionMarker,w=l.attr?l.attr("x"):l.x,p=l.attr? l.attr("y"):l.y,C=l.attr?l.attr("width"):l.width,r=l.attr?l.attr("height"):l.height,B;if(this.hasDragged||f)e.axes.forEach(function(d){if(d.zoomEnabled&&M(d.min)&&(f||c[{xAxis:"zoomX",yAxis:"zoomY"}[d.coll]])){var b=d.horiz,e="touchend"===a.type?d.minPixelPadding:0,m=d.toValue((b?w:p)+e);b=d.toValue((b?w+C:p+r)-e);h[d.coll].push({axis:d,min:Math.min(m,b),max:Math.max(m,b)});B=!0}}),B&&J(e,"selection",h,function(d){e.zoom(y(d,f?{animation:!1}:null))});E(e.index)&&(this.selectionMarker=this.selectionMarker.destroy()); f&&this.scaleGroups()}e&&E(e.index)&&(N(e.container,{cursor:e._cursor}),e.cancelClick=10<this.hasDragged,e.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])};l.prototype.findNearestKDPoint=function(a,c,f){var e=this.chart,m=e.hoverPoint;e=e.tooltip;if(m&&e&&e.isStickyOnContact())return m;var h;a.forEach(function(a){var e=!(a.noSharedTooltip&&c)&&0>a.options.findNearestPointBy.indexOf("y");a=a.searchPoint(f,e);if((e=D(a,!0))&&!(e=!D(h,!0))){e=h.distX-a.distX;var m=h.dist-a.dist,u=(a.series.group&& a.series.group.zIndex)-(h.series.group&&h.series.group.zIndex);e=0<(0!==e&&c?e:0!==m?m:0!==u?u:h.series.index>a.series.index?-1:1)}e&&(h=a)});return h};l.prototype.getChartCoordinatesFromPoint=function(a,c){var e=a.series,f=e.xAxis;e=e.yAxis;var h=q(a.clientX,a.plotX),l=a.shapeArgs;if(f&&e)return c?{chartX:f.len+f.pos-h,chartY:e.len+e.pos-a.plotY}:{chartX:h+f.pos,chartY:a.plotY+e.pos};if(l&&l.x&&l.y)return{chartX:l.x,chartY:l.y}};l.prototype.getChartPosition=function(){return this.chartPosition|| (this.chartPosition=t(this.chart.container))};l.prototype.getCoordinates=function(a){var c={xAxis:[],yAxis:[]};this.chart.axes.forEach(function(e){c[e.isXAxis?"xAxis":"yAxis"].push({axis:e,value:e.toValue(a[e.horiz?"chartX":"chartY"])})});return c};l.prototype.getHoverData=function(a,c,f,h,l,F){var e,m=[];h=!(!h||!a);var u=c&&!c.stickyTracking,r={chartX:F?F.chartX:void 0,chartY:F?F.chartY:void 0,shared:l};J(this,"beforeGetHoverData",r);u=u?[c]:f.filter(function(a){return r.filter?r.filter(a):a.visible&& !(!l&&a.directTouch)&&q(a.options.enableMouseTracking,!0)&&a.stickyTracking});c=(e=h||!F?a:this.findNearestKDPoint(u,l,F))&&e.series;e&&(l&&!c.noSharedTooltip?(u=f.filter(function(a){return r.filter?r.filter(a):a.visible&&!(!l&&a.directTouch)&&q(a.options.enableMouseTracking,!0)&&!a.noSharedTooltip}),u.forEach(function(a){var d=I(a.points,function(b){return b.x===e.x&&!b.isNull});D(d)&&(a.chart.isBoosting&&(d=a.getPoint(d)),m.push(d))})):m.push(e));r={hoverPoint:e};J(this,"afterGetHoverData",r);return{hoverPoint:r.hoverPoint, hoverSeries:c,hoverPoints:m}};l.prototype.getPointFromEvent=function(a){a=a.target;for(var c;a&&!c;)c=a.point,a=a.parentNode;return c};l.prototype.onTrackerMouseOut=function(a){a=a.relatedTarget||a.toElement;var c=this.chart.hoverSeries;this.isDirectTouch=!1;if(!(!c||!a||c.stickyTracking||this.inClass(a,"highcharts-tooltip")||this.inClass(a,"highcharts-series-"+c.index)&&this.inClass(a,"highcharts-tracker")))c.onMouseOut()};l.prototype.inClass=function(a,c){for(var e;a;){if(e=G(a,"class")){if(-1!== e.indexOf(c))return!0;if(-1!==e.indexOf("highcharts-container"))return!1}a=a.parentNode}};l.prototype.init=function(a,c){this.options=c;this.chart=a;this.runChartClick=c.chart.events&&!!c.chart.events.click;this.pinchDown=[];this.lastValidTouch={};H&&(a.tooltip=new H(a,c.tooltip),this.followTouchMove=q(c.tooltip.followTouchMove,!0));this.setDOMEvents()};l.prototype.normalize=function(a,c){var e=a.touches,f=e?e.length?e.item(0):e.changedTouches[0]:a;c||(c=this.getChartPosition());e=f.pageX-c.left; c=f.pageY-c.top;if(f=this.chart.containerScaling)e/=f.scaleX,c/=f.scaleY;return y(a,{chartX:Math.round(e),chartY:Math.round(c)})};l.prototype.onContainerClick=function(a){var c=this.chart,e=c.hoverPoint;a=this.normalize(a);var f=c.plotLeft,h=c.plotTop;c.cancelClick||(e&&this.inClass(a.target,"highcharts-tracker")?(J(e.series,"click",y(a,{point:e})),c.hoverPoint&&e.firePointEvent("click",a)):(y(a,this.getCoordinates(a)),c.isInsidePlot(a.chartX-f,a.chartY-h)&&J(c,"click",a)))};l.prototype.onContainerMouseDown= function(a){a=this.normalize(a);if(k.isFirefox&&0!==a.button)this.onContainerMouseMove(a);if("undefined"===typeof a.button||1===((a.buttons||a.button)&1))this.zoomOption(a),this.dragStart(a)};l.prototype.onContainerMouseLeave=function(a){var c=f[q(k.hoverChartIndex,-1)],e=this.chart.tooltip;a=this.normalize(a);c&&(a.relatedTarget||a.toElement)&&(c.pointer.reset(),c.pointer.chartPosition=void 0);e&&!e.isHidden&&this.reset()};l.prototype.onContainerMouseMove=function(a){var c=this.chart;a=this.normalize(a); this.setHoverChartIndex();a.preventDefault||(a.returnValue=!1);"mousedown"===c.mouseIsDown&&this.drag(a);c.openMenu||!this.inClass(a.target,"highcharts-tracker")&&!c.isInsidePlot(a.chartX-c.plotLeft,a.chartY-c.plotTop)||this.runPointActions(a)};l.prototype.onDocumentTouchEnd=function(a){f[k.hoverChartIndex]&&f[k.hoverChartIndex].pointer.drop(a)};l.prototype.onContainerTouchMove=function(a){this.touch(a)};l.prototype.onContainerTouchStart=function(a){this.zoomOption(a);this.touch(a,!0)};l.prototype.onDocumentMouseMove= function(a){var c=this.chart,e=this.chartPosition;a=this.normalize(a,e);var f=c.tooltip;!e||f&&f.isStickyOnContact()||c.isInsidePlot(a.chartX-c.plotLeft,a.chartY-c.plotTop)||this.inClass(a.target,"highcharts-tracker")||this.reset()};l.prototype.onDocumentMouseUp=function(a){var c=f[q(k.hoverChartIndex,-1)];c&&c.pointer.drop(a)};l.prototype.pinch=function(e){var c=this,f=c.chart,h=c.pinchDown,l=e.touches||[],F=l.length,w=c.lastValidTouch,p=c.hasZoom,C=c.selectionMarker,r={},B=1===F&&(c.inClass(e.target, "highcharts-tracker")&&f.runTrackerClick||c.runChartClick),d={};1<F&&(c.initiated=!0);p&&c.initiated&&!B&&e.preventDefault();[].map.call(l,function(b){return c.normalize(b)});"touchstart"===e.type?([].forEach.call(l,function(b,d){h[d]={chartX:b.chartX,chartY:b.chartY}}),w.x=[h[0].chartX,h[1]&&h[1].chartX],w.y=[h[0].chartY,h[1]&&h[1].chartY],f.axes.forEach(function(b){if(b.zoomEnabled){var d=f.bounds[b.horiz?"h":"v"],a=b.minPixelPadding,c=b.toPixels(Math.min(q(b.options.min,b.dataMin),b.dataMin)), e=b.toPixels(Math.max(q(b.options.max,b.dataMax),b.dataMax)),h=Math.max(c,e);d.min=Math.min(b.pos,Math.min(c,e)-a);d.max=Math.max(b.pos+b.len,h+a)}}),c.res=!0):c.followTouchMove&&1===F?this.runPointActions(c.normalize(e)):h.length&&(C||(c.selectionMarker=C=y({destroy:a,touch:!0},f.plotBox)),c.pinchTranslate(h,l,r,C,d,w),c.hasPinched=p,c.scaleGroups(r,d),c.res&&(c.res=!1,this.reset(!1,0)))};l.prototype.pinchTranslate=function(a,c,f,h,l,F){this.zoomHor&&this.pinchTranslateDirection(!0,a,c,f,h,l,F); this.zoomVert&&this.pinchTranslateDirection(!1,a,c,f,h,l,F)};l.prototype.pinchTranslateDirection=function(a,c,f,h,l,F,w,p){var e=this.chart,m=a?"x":"y",u=a?"X":"Y",d="chart"+u,b=a?"width":"height",n=e["plot"+(a?"Left":"Top")],x,r,q=p||1,t=e.inverted,g=e.bounds[a?"h":"v"],L=1===c.length,k=c[0][d],z=f[0][d],y=!L&&c[1][d],D=!L&&f[1][d];f=function(){"number"===typeof D&&20<Math.abs(k-y)&&(q=p||Math.abs(z-D)/Math.abs(k-y));r=(n-z)/q+k;x=e["plot"+(a?"Width":"Height")]/q};f();c=r;if(c<g.min){c=g.min;var E= !0}else c+x>g.max&&(c=g.max-x,E=!0);E?(z-=.8*(z-w[m][0]),"number"===typeof D&&(D-=.8*(D-w[m][1])),f()):w[m]=[z,D];t||(F[m]=r-n,F[b]=x);F=t?1/q:q;l[b]=x;l[m]=c;h[t?a?"scaleY":"scaleX":"scale"+u]=q;h["translate"+u]=F*n+(z-F*k)};l.prototype.reset=function(a,c){var e=this.chart,f=e.hoverSeries,h=e.hoverPoint,l=e.hoverPoints,w=e.tooltip,p=w&&w.shared?l:h;a&&p&&r(p).forEach(function(c){c.series.isCartesian&&"undefined"===typeof c.plotX&&(a=!1)});if(a)w&&p&&r(p).length&&(w.refresh(p),w.shared&&l?l.forEach(function(a){a.setState(a.state, !0);a.series.isCartesian&&(a.series.xAxis.crosshair&&a.series.xAxis.drawCrosshair(null,a),a.series.yAxis.crosshair&&a.series.yAxis.drawCrosshair(null,a))}):h&&(h.setState(h.state,!0),e.axes.forEach(function(a){a.crosshair&&h.series[a.coll]===a&&a.drawCrosshair(null,h)})));else{if(h)h.onMouseOut();l&&l.forEach(function(a){a.setState()});if(f)f.onMouseOut();w&&w.hide(c);this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove());e.axes.forEach(function(a){a.hideCrosshair()});this.hoverX=e.hoverPoints= e.hoverPoint=null}};l.prototype.runPointActions=function(a,c){var e=this.chart,h=e.tooltip&&e.tooltip.options.enabled?e.tooltip:void 0,l=h?h.shared:!1,F=c||e.hoverPoint,w=F&&F.series||e.hoverSeries;w=this.getHoverData(F,w,e.series,(!a||"touchmove"!==a.type)&&(!!c||w&&w.directTouch&&this.isDirectTouch),l,a);F=w.hoverPoint;var p=w.hoverPoints;c=(w=w.hoverSeries)&&w.tooltipOptions.followPointer;l=l&&w&&!w.noSharedTooltip;if(F&&(F!==e.hoverPoint||h&&h.isHidden)){(e.hoverPoints||[]).forEach(function(a){-1=== p.indexOf(a)&&a.setState()});if(e.hoverSeries!==w)w.onMouseOver();this.applyInactiveState(p);(p||[]).forEach(function(a){a.setState("hover")});e.hoverPoint&&e.hoverPoint.firePointEvent("mouseOut");if(!F.series)return;F.firePointEvent("mouseOver");e.hoverPoints=p;e.hoverPoint=F;h&&h.refresh(l?p:F,a)}else c&&h&&!h.isHidden&&(F=h.getAnchor([{}],a),h.updatePosition({plotX:F[0],plotY:F[1]}));this.unDocMouseMove||(this.unDocMouseMove=K(e.container.ownerDocument,"mousemove",function(a){var c=f[k.hoverChartIndex]; if(c)c.pointer.onDocumentMouseMove(a)}));e.axes.forEach(function(c){var f=q((c.crosshair||{}).snap,!0),h;f&&((h=e.hoverPoint)&&h.series[c.coll]===c||(h=I(p,function(d){return d.series[c.coll]===c})));h||!f?c.drawCrosshair(a,h):c.hideCrosshair()})};l.prototype.scaleGroups=function(a,c){var e=this.chart,f;e.series.forEach(function(h){f=a||h.getPlotBox();h.xAxis&&h.xAxis.zoomEnabled&&h.group&&(h.group.attr(f),h.markerGroup&&(h.markerGroup.attr(f),h.markerGroup.clip(c?e.clipRect:null)),h.dataLabelsGroup&& h.dataLabelsGroup.attr(f))});e.clipRect.attr(c||e.clipBox)};l.prototype.setDOMEvents=function(){var a=this.chart.container,c=a.ownerDocument;a.onmousedown=this.onContainerMouseDown.bind(this);a.onmousemove=this.onContainerMouseMove.bind(this);a.onclick=this.onContainerClick.bind(this);this.unbindContainerMouseLeave=K(a,"mouseleave",this.onContainerMouseLeave.bind(this));k.unbindDocumentMouseUp||(k.unbindDocumentMouseUp=K(c,"mouseup",this.onDocumentMouseUp.bind(this)));k.hasTouch&&(K(a,"touchstart", this.onContainerTouchStart.bind(this)),K(a,"touchmove",this.onContainerTouchMove.bind(this)),k.unbindDocumentTouchEnd||(k.unbindDocumentTouchEnd=K(c,"touchend",this.onDocumentTouchEnd.bind(this))))};l.prototype.setHoverChartIndex=function(){var a=this.chart,c=k.charts[q(k.hoverChartIndex,-1)];if(c&&c!==a)c.pointer.onContainerMouseLeave({relatedTarget:!0});c&&c.mouseIsDown||(k.hoverChartIndex=a.index)};l.prototype.touch=function(a,c){var e=this.chart,f;this.setHoverChartIndex();if(1===a.touches.length)if(a= this.normalize(a),(f=e.isInsidePlot(a.chartX-e.plotLeft,a.chartY-e.plotTop))&&!e.openMenu){c&&this.runPointActions(a);if("touchmove"===a.type){c=this.pinchDown;var h=c[0]?4<=Math.sqrt(Math.pow(c[0].chartX-a.chartX,2)+Math.pow(c[0].chartY-a.chartY,2)):!1}q(h,!0)&&this.pinch(a)}else c&&this.reset();else 2===a.touches.length&&this.pinch(a)};l.prototype.zoomOption=function(a){var c=this.chart,f=c.options.chart,e=f.zoomType||"";c=c.inverted;/touch/.test(a.type)&&(e=q(f.pinchType,e));this.zoomX=a=/x/.test(e); this.zoomY=e=/y/.test(e);this.zoomHor=a&&!c||e&&c;this.zoomVert=e&&!c||a&&c;this.hasZoom=a||e};return l}();k.Pointer=g;return k.Pointer});P(A,"parts/MSPointer.js",[A["parts/Globals.js"],A["parts/Pointer.js"],A["parts/Utilities.js"]],function(k,g,H){function v(){var q=[];q.item=function(r){return this[r]};y(z,function(r){q.push({pageX:r.pageX,pageY:r.pageY,target:r.target})});return q}function K(q,r,h,f){"touch"!==q.pointerType&&q.pointerType!==q.MSPOINTER_TYPE_TOUCH||!J[k.hoverChartIndex]||(f(q), f=J[k.hoverChartIndex].pointer,f[r]({type:h,target:q.currentTarget,preventDefault:D,touches:v()}))}var G=this&&this.__extends||function(){var q=function(r,h){q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,a){f.__proto__=a}||function(f,a){for(var h in a)a.hasOwnProperty(h)&&(f[h]=a[h])};return q(r,h)};return function(r,h){function f(){this.constructor=r}q(r,h);r.prototype=null===h?Object.create(h):(f.prototype=h.prototype,new f)}}(),N=H.addEvent,M=H.css,y=H.objectEach,I=H.removeEvent, J=k.charts,E=k.doc,D=k.noop,z={},t=!!k.win.PointerEvent;return function(q){function r(){return null!==q&&q.apply(this,arguments)||this}G(r,q);r.prototype.batchMSEvents=function(h){h(this.chart.container,t?"pointerdown":"MSPointerDown",this.onContainerPointerDown);h(this.chart.container,t?"pointermove":"MSPointerMove",this.onContainerPointerMove);h(E,t?"pointerup":"MSPointerUp",this.onDocumentPointerUp)};r.prototype.destroy=function(){this.batchMSEvents(I);q.prototype.destroy.call(this)};r.prototype.init= function(h,f){q.prototype.init.call(this,h,f);this.hasZoom&&M(h.container,{"-ms-touch-action":"none","touch-action":"none"})};r.prototype.onContainerPointerDown=function(h){K(h,"onContainerTouchStart","touchstart",function(f){z[f.pointerId]={pageX:f.pageX,pageY:f.pageY,target:f.currentTarget}})};r.prototype.onContainerPointerMove=function(h){K(h,"onContainerTouchMove","touchmove",function(f){z[f.pointerId]={pageX:f.pageX,pageY:f.pageY};z[f.pointerId].target||(z[f.pointerId].target=f.currentTarget)})}; r.prototype.onDocumentPointerUp=function(h){K(h,"onDocumentTouchEnd","touchend",function(f){delete z[f.pointerId]})};r.prototype.setDOMEvents=function(){q.prototype.setDOMEvents.call(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(N)};return r}(g)});P(A,"parts/Legend.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.addEvent,v=g.animObject,K=g.css,G=g.defined,N=g.discardElement,M=g.find,y=g.fireEvent,I=g.format,J=g.isNumber,E=g.merge,D=g.pick,z=g.relativeLength, t=g.setAnimation,q=g.stableSort,r=g.syncTimeout;g=g.wrap;var h=k.isFirefox,f=k.marginNames,a=k.win,l=function(){function a(a,f){this.allItems=[];this.contentGroup=this.box=void 0;this.display=!1;this.group=void 0;this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0;this.options={};this.padding=0;this.pages=[];this.proximate=!1;this.scrollGroup= void 0;this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0;this.chart=a;this.init(a,f)}a.prototype.init=function(a,f){this.chart=a;this.setOptions(f);f.enabled&&(this.render(),H(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=H(this.chart,"render",function(){this.legend.proximatePositions();this.legend.positionItems()}):this.unchartrender&&this.unchartrender())};a.prototype.setOptions=function(a){var c=D(a.padding, 8);this.options=a;this.chart.styledMode||(this.itemStyle=a.itemStyle,this.itemHiddenStyle=E(this.itemStyle,a.itemHiddenStyle));this.itemMarginTop=a.itemMarginTop||0;this.itemMarginBottom=a.itemMarginBottom||0;this.padding=c;this.initialItemY=c-5;this.symbolWidth=D(a.symbolWidth,16);this.pages=[];this.proximate="proximate"===a.layout&&!this.chart.inverted;this.baseline=void 0};a.prototype.update=function(a,f){var c=this.chart;this.setOptions(E(!0,this.options,a));this.destroy();c.isDirtyLegend=c.isDirtyBox= !0;D(f,!0)&&c.redraw();y(this,"afterUpdate")};a.prototype.colorizeItem=function(a,f){a.legendGroup[f?"removeClass":"addClass"]("highcharts-legend-item-hidden");if(!this.chart.styledMode){var c=this.options,e=a.legendItem,h=a.legendLine,m=a.legendSymbol,p=this.itemHiddenStyle.color;c=f?c.itemStyle.color:p;var l=f?a.color||p:p,r=a.options&&a.options.marker,q={fill:l};e&&e.css({fill:c,color:c});h&&h.attr({stroke:l});m&&(r&&m.isMarker&&(q=a.pointAttribs(),f||(q.stroke=q.fill=p)),m.attr(q))}y(this,"afterColorizeItem", {item:a,visible:f})};a.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this);this.chart.isResizing||this.positionCheckboxes()};a.prototype.positionItem=function(a){var c=this.options,f=c.symbolPadding;c=!c.rtl;var e=a._legendItemPos,h=e[0];e=e[1];var w=a.checkbox;if((a=a.legendGroup)&&a.element)a[G(a.translateY)?"animate":"attr"]({translateX:c?h:this.legendWidth-h-2*f-4,translateY:e});w&&(w.x=h,w.y=e)};a.prototype.destroyItem=function(a){var c=a.checkbox;["legendItem","legendLine", "legendSymbol","legendGroup"].forEach(function(c){a[c]&&(a[c]=a[c].destroy())});c&&N(a.checkbox)};a.prototype.destroy=function(){function a(a){this[a]&&(this[a]=this[a].destroy())}this.getAllItems().forEach(function(c){["legendItem","legendGroup"].forEach(a,c)});"clipRect up down pager nav box title group".split(" ").forEach(a,this);this.display=null};a.prototype.positionCheckboxes=function(){var a=this.group&&this.group.alignAttr,f=this.clipHeight||this.legendHeight,e=this.titleHeight;if(a){var h= a.translateY;this.allItems.forEach(function(c){var m=c.checkbox;if(m){var p=h+e+m.y+(this.scrollOffset||0)+3;K(m,{left:a.translateX+c.checkboxOffset+m.x-20+"px",top:p+"px",display:this.proximate||p>h-6&&p<h+f-6?"":"none"})}},this)}};a.prototype.renderTitle=function(){var a=this.options,f=this.padding,e=a.title,h=0;e.text&&(this.title||(this.title=this.chart.renderer.label(e.text,f-3,f-4,null,null,null,a.useHTML,null,"legend-title").attr({zIndex:1}),this.chart.styledMode||this.title.css(e.style),this.title.add(this.group)), e.width||this.title.css({width:this.maxLegendWidth+"px"}),a=this.title.getBBox(),h=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:h}));this.titleHeight=h};a.prototype.setText=function(a){var c=this.options;a.legendItem.attr({text:c.labelFormat?I(c.labelFormat,a,this.chart):c.labelFormatter.call(a)})};a.prototype.renderItem=function(a){var c=this.chart,f=c.renderer,e=this.options,h=this.symbolWidth,w=e.symbolPadding,p=this.itemStyle,l=this.itemHiddenStyle,r="horizontal"===e.layout? D(e.itemDistance,20):0,q=!e.rtl,d=a.legendItem,b=!a.series,n=!b&&a.series.drawLegendSymbol?a.series:a,x=n.options;x=this.createCheckboxForItem&&x&&x.showCheckbox;r=h+w+r+(x?20:0);var t=e.useHTML,g=a.options.className;d||(a.legendGroup=f.g("legend-item").addClass("highcharts-"+n.type+"-series highcharts-color-"+a.colorIndex+(g?" "+g:"")+(b?" highcharts-series-"+a.index:"")).attr({zIndex:1}).add(this.scrollGroup),a.legendItem=d=f.text("",q?h+w:-w,this.baseline||0,t),c.styledMode||d.css(E(a.visible? p:l)),d.attr({align:q?"left":"right",zIndex:2}).add(a.legendGroup),this.baseline||(this.fontMetrics=f.fontMetrics(c.styledMode?12:p.fontSize,d),this.baseline=this.fontMetrics.f+3+this.itemMarginTop,d.attr("y",this.baseline)),this.symbolHeight=e.symbolHeight||this.fontMetrics.f,n.drawLegendSymbol(this,a),this.setItemEvents&&this.setItemEvents(a,d,t));x&&!a.checkbox&&this.createCheckboxForItem&&this.createCheckboxForItem(a);this.colorizeItem(a,a.visible);!c.styledMode&&p.width||d.css({width:(e.itemWidth|| this.widthOption||c.spacingBox.width)-r+"px"});this.setText(a);c=d.getBBox();a.itemWidth=a.checkboxOffset=e.itemWidth||a.legendItemWidth||c.width+r;this.maxItemWidth=Math.max(this.maxItemWidth,a.itemWidth);this.totalItemWidth+=a.itemWidth;this.itemHeight=a.itemHeight=Math.round(a.legendItemHeight||c.height||this.symbolHeight)};a.prototype.layoutItem=function(a){var c=this.options,f=this.padding,e="horizontal"===c.layout,h=a.itemHeight,w=this.itemMarginBottom,p=this.itemMarginTop,l=e?D(c.itemDistance, 20):0,r=this.maxLegendWidth;c=c.alignColumns&&this.totalItemWidth>r?this.maxItemWidth:a.itemWidth;e&&this.itemX-f+c>r&&(this.itemX=f,this.lastLineHeight&&(this.itemY+=p+this.lastLineHeight+w),this.lastLineHeight=0);this.lastItemY=p+this.itemY+w;this.lastLineHeight=Math.max(h,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=c:(this.itemY+=p+h+w,this.lastLineHeight=h);this.offsetWidth=this.widthOption||Math.max((e?this.itemX-f-(a.checkbox?0:l):c)+f,this.offsetWidth)};a.prototype.getAllItems= function(){var a=[];this.chart.series.forEach(function(c){var f=c&&c.options;c&&D(f.showInLegend,G(f.linkedTo)?!1:void 0,!0)&&(a=a.concat(c.legendItems||("point"===f.legendType?c.data:c)))});y(this,"afterGetAllItems",{allItems:a});return a};a.prototype.getAlignment=function(){var a=this.options;return this.proximate?a.align.charAt(0)+"tv":a.floating?"":a.align.charAt(0)+a.verticalAlign.charAt(0)+a.layout.charAt(0)};a.prototype.adjustMargins=function(a,e){var c=this.chart,h=this.options,m=this.getAlignment(); m&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function(u,p){u.test(m)&&!G(a[p])&&(c[f[p]]=Math.max(c[f[p]],c.legend[(p+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][p]*h[p%2?"x":"y"]+D(h.margin,12)+e[p]+(c.titleOffset[p]||0)))})};a.prototype.proximatePositions=function(){var a=this.chart,f=[],e="left"===this.options.align;this.allItems.forEach(function(c){var h=e;if(c.yAxis&&c.points){c.xAxis.options.reversed&&(h=!h);var m=M(h?c.points:c.points.slice(0).reverse(),function(a){return J(a.plotY)}); h=this.itemMarginTop+c.legendItem.getBBox().height+this.itemMarginBottom;var p=c.yAxis.top-a.plotTop;c.visible?(m=m?m.plotY:c.yAxis.height,m+=p-.3*h):m=p+c.yAxis.height;f.push({target:m,size:h,item:c})}},this);k.distribute(f,a.plotHeight);f.forEach(function(c){c.item._legendItemPos[1]=a.plotTop-a.spacing[0]+c.pos})};a.prototype.render=function(){var a=this.chart,f=a.renderer,e=this.group,h=this.box,l=this.options,w=this.padding;this.itemX=w;this.itemY=this.initialItemY;this.lastItemY=this.offsetWidth= 0;this.widthOption=z(l.width,a.spacingBox.width-w);var p=a.spacingBox.width-2*w-l.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(p/=2);this.maxLegendWidth=this.widthOption||p;e||(this.group=e=f.g("legend").attr({zIndex:7}).add(),this.contentGroup=f.g().attr({zIndex:1}).add(e),this.scrollGroup=f.g().add(this.contentGroup));this.renderTitle();var C=this.getAllItems();q(C,function(a,d){return(a.options&&a.options.legendIndex||0)-(d.options&&d.options.legendIndex||0)});l.reversed&&C.reverse(); this.allItems=C;this.display=p=!!C.length;this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0;C.forEach(this.renderItem,this);C.forEach(this.layoutItem,this);C=(this.widthOption||this.offsetWidth)+w;var r=this.lastItemY+this.lastLineHeight+this.titleHeight;r=this.handleOverflow(r);r+=w;h||(this.box=h=f.rect().addClass("highcharts-legend-box").attr({r:l.borderRadius}).add(e),h.isNew=!0);a.styledMode||h.attr({stroke:l.borderColor,"stroke-width":l.borderWidth||0,fill:l.backgroundColor|| "none"}).shadow(l.shadow);0<C&&0<r&&(h[h.isNew?"attr":"animate"](h.crisp.call({},{x:0,y:0,width:C,height:r},h.strokeWidth())),h.isNew=!1);h[p?"show":"hide"]();a.styledMode&&"none"===e.getStyle("display")&&(C=r=0);this.legendWidth=C;this.legendHeight=r;p&&this.align();this.proximate||this.positionItems();y(this,"afterRender")};a.prototype.align=function(a){void 0===a&&(a=this.chart.spacingBox);var c=this.chart,f=this.options,e=a.y;/(lth|ct|rth)/.test(this.getAlignment())&&0<c.titleOffset[0]?e+=c.titleOffset[0]: /(lbh|cb|rbh)/.test(this.getAlignment())&&0<c.titleOffset[2]&&(e-=c.titleOffset[2]);e!==a.y&&(a=E(a,{y:e}));this.group.align(E(f,{width:this.legendWidth,height:this.legendHeight,verticalAlign:this.proximate?"top":f.verticalAlign}),!0,a)};a.prototype.handleOverflow=function(a){var c=this,f=this.chart,e=f.renderer,h=this.options,l=h.y,p=this.padding;l=f.spacingBox.height+("top"===h.verticalAlign?-l:l)-p;var C=h.maxHeight,r,q=this.clipRect,d=h.navigation,b=D(d.animation,!0),n=d.arrowSize||12,x=this.nav, t=this.pages,g,k=this.allItems,z=function(b){"number"===typeof b?q.attr({height:b}):q&&(c.clipRect=q.destroy(),c.contentGroup.clip());c.contentGroup.div&&(c.contentGroup.div.style.clip=b?"rect("+p+"px,9999px,"+(p+b)+"px,0)":"auto")},y=function(b){c[b]=e.circle(0,0,1.3*n).translate(n/2,n/2).add(x);f.styledMode||c[b].attr("fill","rgba(0,0,0,0.0001)");return c[b]};"horizontal"!==h.layout||"middle"===h.verticalAlign||h.floating||(l/=2);C&&(l=Math.min(l,C));t.length=0;a>l&&!1!==d.enabled?(this.clipHeight= r=Math.max(l-20-this.titleHeight-p,0),this.currentPage=D(this.currentPage,1),this.fullHeight=a,k.forEach(function(b,a){var d=b._legendItemPos[1],c=Math.round(b.legendItem.getBBox().height),f=t.length;if(!f||d-t[f-1]>r&&(g||d)!==t[f-1])t.push(g||d),f++;b.pageIx=f-1;g&&(k[a-1].pageIx=f-1);a===k.length-1&&d+c-t[f-1]>r&&d!==g&&(t.push(d),b.pageIx=f);d!==g&&(g=d)}),q||(q=c.clipRect=e.clipRect(0,p,9999,0),c.contentGroup.clip(q)),z(r),x||(this.nav=x=e.g().attr({zIndex:1}).add(this.group),this.up=e.symbol("triangle", 0,0,n,n).add(x),y("upTracker").on("click",function(){c.scroll(-1,b)}),this.pager=e.text("",15,10).addClass("highcharts-legend-navigation"),f.styledMode||this.pager.css(d.style),this.pager.add(x),this.down=e.symbol("triangle-down",0,0,n,n).add(x),y("downTracker").on("click",function(){c.scroll(1,b)})),c.scroll(0),a=l):x&&(z(),this.nav=x.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a};a.prototype.scroll=function(a,f){var c=this,e=this.chart,h=this.pages,m=h.length,p=this.currentPage+ a;a=this.clipHeight;var l=this.options.navigation,q=this.pager,g=this.padding;p>m&&(p=m);0<p&&("undefined"!==typeof f&&t(f,e),this.nav.attr({translateX:g,translateY:a+this.padding+7+this.titleHeight,visibility:"visible"}),[this.up,this.upTracker].forEach(function(a){a.attr({"class":1===p?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})}),q.attr({text:p+"/"+m}),[this.down,this.downTracker].forEach(function(a){a.attr({x:18+this.pager.getBBox().width,"class":p===m?"highcharts-legend-nav-inactive": "highcharts-legend-nav-active"})},this),e.styledMode||(this.up.attr({fill:1===p?l.inactiveColor:l.activeColor}),this.upTracker.css({cursor:1===p?"default":"pointer"}),this.down.attr({fill:p===m?l.inactiveColor:l.activeColor}),this.downTracker.css({cursor:p===m?"default":"pointer"})),this.scrollOffset=-h[p-1]+this.initialItemY,this.scrollGroup.animate({translateY:this.scrollOffset}),this.currentPage=p,this.positionCheckboxes(),f=v(D(f,e.renderer.globalAnimation,!0)),r(function(){y(c,"afterScroll", {currentPage:p})},f.duration||0))};return a}();(/Trident\/7\.0/.test(a.navigator&&a.navigator.userAgent)||h)&&g(l.prototype,"positionItem",function(a,c){var f=this,e=function(){c._legendItemPos&&a.call(f,c)};e();f.bubbleLegend||setTimeout(e)});k.Legend=l;return k.Legend});P(A,"parts/Chart.js",[A["parts/Globals.js"],A["parts/Legend.js"],A["parts/MSPointer.js"],A["parts/Pointer.js"],A["parts/Time.js"],A["parts/Utilities.js"]],function(k,g,H,v,K,G){var N=G.addEvent,M=G.animate,y=G.animObject,I=G.attr, J=G.createElement,E=G.css,D=G.defined,z=G.discardElement,t=G.erase,q=G.error,r=G.extend,h=G.find,f=G.fireEvent,a=G.getStyle,l=G.isArray,e=G.isFunction,c=G.isNumber,m=G.isObject,u=G.isString,L=G.merge,F=G.numberFormat,w=G.objectEach,p=G.pick,C=G.pInt,O=G.relativeLength,B=G.removeEvent,d=G.setAnimation,b=G.splat,n=G.syncTimeout,x=G.uniqueKey,Q=k.doc,R=k.Axis,X=k.defaultOptions,U=k.charts,V=k.marginNames,W=k.seriesTypes,A=k.win,Y=k.Chart=function(){this.getArgs.apply(this,arguments)};k.chart=function(b, a,d){return new Y(b,a,d)};r(Y.prototype,{callbacks:[],getArgs:function(){var b=[].slice.call(arguments);if(u(b[0])||b[0].nodeName)this.renderTo=b.shift();this.init(b[0],b[1])},init:function(b,a){var d,c=b.series,n=b.plotOptions||{};f(this,"init",{args:arguments},function(){b.series=null;d=L(X,b);var h=d.chart||{};w(d.plotOptions,function(b,a){m(b)&&(b.tooltip=n[a]&&L(n[a].tooltip)||void 0)});d.tooltip.userOptions=b.chart&&b.chart.forExport&&b.tooltip.userOptions||b.tooltip;d.series=b.series=c;this.userOptions= b;var p=h.events;this.margin=[];this.spacing=[];this.bounds={h:{},v:{}};this.labelCollectors=[];this.callback=a;this.isResizing=0;this.options=d;this.axes=[];this.series=[];this.time=b.time&&Object.keys(b.time).length?new K(b.time):k.time;this.numberFormatter=h.numberFormatter||F;this.styledMode=h.styledMode;this.hasCartesianSeries=h.showAxes;var l=this;l.index=U.length;U.push(l);k.chartCount++;p&&w(p,function(b,a){e(b)&&N(l,a,b)});l.xAxis=[];l.yAxis=[];l.pointCount=l.colorCounter=l.symbolCounter= 0;f(l,"afterInit");l.firstRender()})},initSeries:function(b){var a=this.options.chart;a=b.type||a.type||a.defaultSeriesType;var d=W[a];d||q(17,!0,this,{missingModuleFor:a});a=new d;a.init(this,b);return a},setSeriesData:function(){this.getSeriesOrderByLinks().forEach(function(b){b.points||b.data||!b.enabledDataSorting||b.setData(b.options.data,!1)})},getSeriesOrderByLinks:function(){return this.series.concat().sort(function(b,a){return b.linkedSeries.length||a.linkedSeries.length?a.linkedSeries.length- b.linkedSeries.length:0})},orderSeries:function(b){var a=this.series;for(b=b||0;b<a.length;b++)a[b]&&(a[b].index=b,a[b].name=a[b].getName())},isInsidePlot:function(b,a,d){var c=d?a:b;b=d?b:a;c={x:c,y:b,isInsidePlot:0<=c&&c<=this.plotWidth&&0<=b&&b<=this.plotHeight};f(this,"afterIsInsidePlot",c);return c.isInsidePlot},redraw:function(b){f(this,"beforeRedraw");var a=this.axes,c=this.series,e=this.pointer,n=this.legend,h=this.userOptions.legend,p=this.isDirtyLegend,l=this.hasCartesianSeries,m=this.isDirtyBox, x=this.renderer,u=x.isHidden(),w=[];this.setResponsive&&this.setResponsive(!1);d(this.hasRendered?b:!1,this);u&&this.temporaryDisplay();this.layOutTitles();for(b=c.length;b--;){var C=c[b];if(C.options.stacking){var F=!0;if(C.isDirty){var q=!0;break}}}if(q)for(b=c.length;b--;)C=c[b],C.options.stacking&&(C.isDirty=!0);c.forEach(function(b){b.isDirty&&("point"===b.options.legendType?(b.updateTotals&&b.updateTotals(),p=!0):h&&(h.labelFormatter||h.labelFormat)&&(p=!0));b.isDirtyData&&f(b,"updatedData")}); p&&n&&n.options.enabled&&(n.render(),this.isDirtyLegend=!1);F&&this.getStacks();l&&a.forEach(function(b){b.updateNames();b.setScale()});this.getMargins();l&&(a.forEach(function(b){b.isDirty&&(m=!0)}),a.forEach(function(b){var a=b.min+","+b.max;b.extKey!==a&&(b.extKey=a,w.push(function(){f(b,"afterSetExtremes",r(b.eventArgs,b.getExtremes()));delete b.eventArgs}));(m||F)&&b.redraw()}));m&&this.drawChartBox();f(this,"predraw");c.forEach(function(b){(m||b.isDirty)&&b.visible&&b.redraw();b.isDirtyData= !1});e&&e.reset(!0);x.draw();f(this,"redraw");f(this,"render");u&&this.temporaryDisplay(!0);w.forEach(function(b){b.call()})},get:function(b){function a(a){return a.id===b||a.options&&a.options.id===b}var d=this.series,c;var f=h(this.axes,a)||h(this.series,a);for(c=0;!f&&c<d.length;c++)f=h(d[c].points||[],a);return f},getAxes:function(){var a=this,d=this.options,c=d.xAxis=b(d.xAxis||{});d=d.yAxis=b(d.yAxis||{});f(this,"getAxes");c.forEach(function(b,a){b.index=a;b.isX=!0});d.forEach(function(b,a){b.index= a});c.concat(d).forEach(function(b){new R(a,b)});f(this,"afterGetAxes")},getSelectedPoints:function(){var b=[];this.series.forEach(function(a){b=b.concat(a.getPointsCollection().filter(function(b){return p(b.selectedStaging,b.selected)}))});return b},getSelectedSeries:function(){return this.series.filter(function(b){return b.selected})},setTitle:function(b,a,d){this.applyDescription("title",b);this.applyDescription("subtitle",a);this.applyDescription("caption",void 0);this.layOutTitles(d)},applyDescription:function(b, a){var d=this,c="title"===b?{color:"#333333",fontSize:this.options.isStock?"16px":"18px"}:{color:"#666666"};c=this.options[b]=L(!this.styledMode&&{style:c},this.options[b],a);var f=this[b];f&&a&&(this[b]=f=f.destroy());c&&!f&&(f=this.renderer.text(c.text,0,0,c.useHTML).attr({align:c.align,"class":"highcharts-"+b,zIndex:c.zIndex||4}).add(),f.update=function(a){d[{title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"}[b]](a)},this.styledMode||f.css(c.style),this[b]=f)},layOutTitles:function(b){var a= [0,0,0],d=this.renderer,c=this.spacingBox;["title","subtitle","caption"].forEach(function(b){var f=this[b],e=this.options[b],n=e.verticalAlign||"top";b="title"===b?-3:"top"===n?a[0]+2:0;if(f){if(!this.styledMode)var h=e.style.fontSize;h=d.fontMetrics(h,f).b;f.css({width:(e.width||c.width+(e.widthAdjust||0))+"px"});var p=Math.round(f.getBBox(e.useHTML).height);f.align(r({y:"bottom"===n?h:b+h,height:p},e),!1,"spacingBox");e.floating||("top"===n?a[0]=Math.ceil(a[0]+p):"bottom"===n&&(a[2]=Math.ceil(a[2]+ p)))}},this);a[0]&&"top"===(this.options.title.verticalAlign||"top")&&(a[0]+=this.options.title.margin);a[2]&&"bottom"===this.options.caption.verticalAlign&&(a[2]+=this.options.caption.margin);var e=!this.titleOffset||this.titleOffset.join(",")!==a.join(",");this.titleOffset=a;f(this,"afterLayOutTitles");!this.isDirtyBox&&e&&(this.isDirtyBox=this.isDirtyLegend=e,this.hasRendered&&p(b,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var b=this.options.chart,d=b.width;b=b.height;var c= this.renderTo;D(d)||(this.containerWidth=a(c,"width"));D(b)||(this.containerHeight=a(c,"height"));this.chartWidth=Math.max(0,d||this.containerWidth||600);this.chartHeight=Math.max(0,O(b,this.chartWidth)||(1<this.containerHeight?this.containerHeight:400))},temporaryDisplay:function(b){var d=this.renderTo;if(b)for(;d&&d.style;)d.hcOrigStyle&&(E(d,d.hcOrigStyle),delete d.hcOrigStyle),d.hcOrigDetached&&(Q.body.removeChild(d),d.hcOrigDetached=!1),d=d.parentNode;else for(;d&&d.style;){Q.body.contains(d)|| d.parentNode||(d.hcOrigDetached=!0,Q.body.appendChild(d));if("none"===a(d,"display",!1)||d.hcOricDetached)d.hcOrigStyle={display:d.style.display,height:d.style.height,overflow:d.style.overflow},b={display:"block",overflow:"hidden"},d!==this.renderTo&&(b.height=0),E(d,b),d.offsetWidth||d.style.setProperty("display","block","important");d=d.parentNode;if(d===Q.body)break}},setClassName:function(b){this.container.className="highcharts-container "+(b||"")},getContainer:function(){var b=this.options,a= b.chart;var e=this.renderTo;var n=x(),h,p;e||(this.renderTo=e=a.renderTo);u(e)&&(this.renderTo=e=Q.getElementById(e));e||q(13,!0,this);var m=C(I(e,"data-highcharts-chart"));c(m)&&U[m]&&U[m].hasRendered&&U[m].destroy();I(e,"data-highcharts-chart",this.index);e.innerHTML="";a.skipClone||e.offsetWidth||this.temporaryDisplay();this.getChartSize();m=this.chartWidth;var l=this.chartHeight;E(e,{overflow:"hidden"});this.styledMode||(h=r({position:"relative",overflow:"hidden",width:m+"px",height:l+"px",textAlign:"left", lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},a.style));this.container=e=J("div",{id:n},h,e);this._cursor=e.style.cursor;this.renderer=new (k[a.renderer]||k.Renderer)(e,m,l,null,a.forExport,b.exporting&&b.exporting.allowHTML,this.styledMode);d(void 0,this);this.setClassName(a.className);if(this.styledMode)for(p in b.defs)this.renderer.definition(b.defs[p]);else this.renderer.setStyle(a.style);this.renderer.chartIndex=this.index;f(this,"afterGetContainer")},getMargins:function(b){var a= this.spacing,d=this.margin,c=this.titleOffset;this.resetMargins();c[0]&&!D(d[0])&&(this.plotTop=Math.max(this.plotTop,c[0]+a[0]));c[2]&&!D(d[2])&&(this.marginBottom=Math.max(this.marginBottom,c[2]+a[2]));this.legend&&this.legend.display&&this.legend.adjustMargins(d,a);f(this,"getMargins");b||this.getAxisMargins()},getAxisMargins:function(){var b=this,a=b.axisOffset=[0,0,0,0],d=b.colorAxis,c=b.margin,f=function(b){b.forEach(function(b){b.visible&&b.getOffset()})};b.hasCartesianSeries?f(b.axes):d&& d.length&&f(d);V.forEach(function(d,f){D(c[f])||(b[d]+=a[f])});b.setChartSize()},reflow:function(b){var d=this,c=d.options.chart,f=d.renderTo,e=D(c.width)&&D(c.height),h=c.width||a(f,"width");c=c.height||a(f,"height");f=b?b.target:A;if(!e&&!d.isPrinting&&h&&c&&(f===A||f===Q)){if(h!==d.containerWidth||c!==d.containerHeight)G.clearTimeout(d.reflowTimeout),d.reflowTimeout=n(function(){d.container&&d.setSize(void 0,void 0,!1)},b?100:0);d.containerWidth=h;d.containerHeight=c}},setReflow:function(b){var a= this;!1===b||this.unbindReflow?!1===b&&this.unbindReflow&&(this.unbindReflow=this.unbindReflow()):(this.unbindReflow=N(A,"resize",function(b){a.options&&a.reflow(b)}),N(this,"destroy",this.unbindReflow))},setSize:function(b,a,c){var e=this,h=e.renderer;e.isResizing+=1;d(c,e);c=h.globalAnimation;e.oldChartHeight=e.chartHeight;e.oldChartWidth=e.chartWidth;"undefined"!==typeof b&&(e.options.chart.width=b);"undefined"!==typeof a&&(e.options.chart.height=a);e.getChartSize();e.styledMode||(c?M:E)(e.container, {width:e.chartWidth+"px",height:e.chartHeight+"px"},c);e.setChartSize(!0);h.setSize(e.chartWidth,e.chartHeight,c);e.axes.forEach(function(b){b.isDirty=!0;b.setScale()});e.isDirtyLegend=!0;e.isDirtyBox=!0;e.layOutTitles();e.getMargins();e.redraw(c);e.oldChartHeight=null;f(e,"resize");n(function(){e&&f(e,"endResize",null,function(){--e.isResizing})},y(c).duration||0)},setChartSize:function(b){var a=this.inverted,d=this.renderer,c=this.chartWidth,e=this.chartHeight,n=this.options.chart,h=this.spacing, p=this.clipOffset,m,l,x,u;this.plotLeft=m=Math.round(this.plotLeft);this.plotTop=l=Math.round(this.plotTop);this.plotWidth=x=Math.max(0,Math.round(c-m-this.marginRight));this.plotHeight=u=Math.max(0,Math.round(e-l-this.marginBottom));this.plotSizeX=a?u:x;this.plotSizeY=a?x:u;this.plotBorderWidth=n.plotBorderWidth||0;this.spacingBox=d.spacingBox={x:h[3],y:h[0],width:c-h[3]-h[1],height:e-h[0]-h[2]};this.plotBox=d.plotBox={x:m,y:l,width:x,height:u};c=2*Math.floor(this.plotBorderWidth/2);a=Math.ceil(Math.max(c, p[3])/2);d=Math.ceil(Math.max(c,p[0])/2);this.clipBox={x:a,y:d,width:Math.floor(this.plotSizeX-Math.max(c,p[1])/2-a),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(c,p[2])/2-d))};b||this.axes.forEach(function(b){b.setAxisSize();b.setAxisTranslation()});f(this,"afterSetChartSize",{skipAxes:b})},resetMargins:function(){f(this,"resetMargins");var b=this,a=b.options.chart;["margin","spacing"].forEach(function(d){var c=a[d],e=m(c)?c:[c,c,c,c];["Top","Right","Bottom","Left"].forEach(function(c,f){b[d][f]= p(a[d+c],e[f])})});V.forEach(function(a,d){b[a]=p(b.margin[d],b.spacing[d])});b.axisOffset=[0,0,0,0];b.clipOffset=[0,0,0,0]},drawChartBox:function(){var b=this.options.chart,a=this.renderer,d=this.chartWidth,c=this.chartHeight,e=this.chartBackground,h=this.plotBackground,n=this.plotBorder,p=this.styledMode,m=this.plotBGImage,l=b.backgroundColor,x=b.plotBackgroundColor,u=b.plotBackgroundImage,w,C=this.plotLeft,r=this.plotTop,F=this.plotWidth,q=this.plotHeight,t=this.plotBox,g=this.clipRect,B=this.clipBox, O="animate";e||(this.chartBackground=e=a.rect().addClass("highcharts-background").add(),O="attr");if(p)var k=w=e.strokeWidth();else{k=b.borderWidth||0;w=k+(b.shadow?8:0);l={fill:l||"none"};if(k||e["stroke-width"])l.stroke=b.borderColor,l["stroke-width"]=k;e.attr(l).shadow(b.shadow)}e[O]({x:w/2,y:w/2,width:d-w-k%2,height:c-w-k%2,r:b.borderRadius});O="animate";h||(O="attr",this.plotBackground=h=a.rect().addClass("highcharts-plot-background").add());h[O](t);p||(h.attr({fill:x||"none"}).shadow(b.plotShadow), u&&(m?(u!==m.attr("href")&&m.attr("href",u),m.animate(t)):this.plotBGImage=a.image(u,C,r,F,q).add()));g?g.animate({width:B.width,height:B.height}):this.clipRect=a.clipRect(B);O="animate";n||(O="attr",this.plotBorder=n=a.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());p||n.attr({stroke:b.plotBorderColor,"stroke-width":b.plotBorderWidth||0,fill:"none"});n[O](n.crisp({x:C,y:r,width:F,height:q},-n.strokeWidth()));this.isDirtyBox=!1;f(this,"afterDrawChartBox")},propFromSeries:function(){var b= this,a=b.options.chart,d,c=b.options.series,e,f;["inverted","angular","polar"].forEach(function(h){d=W[a.type||a.defaultSeriesType];f=a[h]||d&&d.prototype[h];for(e=c&&c.length;!f&&e--;)(d=W[c[e].type])&&d.prototype[h]&&(f=!0);b[h]=f})},linkSeries:function(){var b=this,a=b.series;a.forEach(function(b){b.linkedSeries.length=0});a.forEach(function(a){var d=a.options.linkedTo;u(d)&&(d=":previous"===d?b.series[a.index-1]:b.get(d))&&d.linkedParent!==a&&(d.linkedSeries.push(a),a.linkedParent=d,d.enabledDataSorting&& a.setDataSortingOptions(),a.visible=p(a.options.visible,d.options.visible,a.visible))});f(this,"afterLinkSeries")},renderSeries:function(){this.series.forEach(function(b){b.translate();b.render()})},renderLabels:function(){var b=this,a=b.options.labels;a.items&&a.items.forEach(function(d){var c=r(a.style,d.style),e=C(c.left)+b.plotLeft,f=C(c.top)+b.plotTop+12;delete c.left;delete c.top;b.renderer.text(d.html,e,f).attr({zIndex:2}).css(c).add()})},render:function(){var b=this.axes,a=this.colorAxis, d=this.renderer,c=this.options,e=0,f=function(b){b.forEach(function(b){b.visible&&b.render()})};this.setTitle();this.legend=new g(this,c.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();c=this.plotWidth;b.some(function(b){if(b.horiz&&b.visible&&b.options.labels.enabled&&b.series.length)return e=21,!0});var h=this.plotHeight=Math.max(this.plotHeight-e,0);b.forEach(function(b){b.setScale()});this.getAxisMargins();var n=1.1<c/this.plotWidth;var p=1.05<h/this.plotHeight; if(n||p)b.forEach(function(b){(b.horiz&&n||!b.horiz&&p)&&b.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries?f(b):a&&a.length&&f(a);this.seriesGroup||(this.seriesGroup=d.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.updateContainerScaling();this.hasRendered=!0},addCredits:function(b){var a=this;b=L(!0,this.options.credits,b);b.enabled&&!this.credits&&(this.credits= this.renderer.text(b.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",function(){b.href&&(A.location.href=b.href)}).attr({align:b.position.align,zIndex:8}),a.styledMode||this.credits.css(b.style),this.credits.add().align(b.position),this.credits.update=function(b){a.credits=a.credits.destroy();a.addCredits(b)})},updateContainerScaling:function(){var b=this.container;if(b.offsetWidth&&b.offsetHeight&&b.getBoundingClientRect){var a=b.getBoundingClientRect(),d=a.width/b.offsetWidth; b=a.height/b.offsetHeight;1!==d||1!==b?this.containerScaling={scaleX:d,scaleY:b}:delete this.containerScaling}},destroy:function(){var b=this,a=b.axes,d=b.series,c=b.container,e,h=c&&c.parentNode;f(b,"destroy");b.renderer.forExport?t(U,b):U[b.index]=void 0;k.chartCount--;b.renderTo.removeAttribute("data-highcharts-chart");B(b);for(e=a.length;e--;)a[e]=a[e].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(e=d.length;e--;)d[e]=d[e].destroy();"title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" ").forEach(function(a){var d= b[a];d&&d.destroy&&(b[a]=d.destroy())});c&&(c.innerHTML="",B(c),h&&z(c));w(b,function(a,d){delete b[d]})},firstRender:function(){var b=this,a=b.options;if(!b.isReadyToRender||b.isReadyToRender()){b.getContainer();b.resetMargins();b.setChartSize();b.propFromSeries();b.getAxes();(l(a.series)?a.series:[]).forEach(function(a){b.initSeries(a)});b.linkSeries();b.setSeriesData();f(b,"beforeRender");v&&(b.pointer=k.hasTouch||!A.PointerEvent&&!A.MSPointerEvent?new v(b,a):new H(b,a));b.render();if(!b.renderer.imgCount&& !b.hasLoaded)b.onload();b.temporaryDisplay(!0)}},onload:function(){this.callbacks.concat([this.callback]).forEach(function(b){b&&"undefined"!==typeof this.index&&b.apply(this,[this])},this);f(this,"load");f(this,"render");D(this.index)&&this.setReflow(this.options.chart.reflow);this.hasLoaded=!0}})});P(A,"parts/ScrollablePlotArea.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.addEvent,v=g.createElement,K=g.pick,G=g.stop;g=k.Chart;"";H(g,"afterSetChartSize",function(g){var v= this.options.chart.scrollablePlotArea,y=v&&v.minWidth;v=v&&v.minHeight;if(!this.renderer.forExport){if(y){if(this.scrollablePixelsX=y=Math.max(0,y-this.chartWidth)){this.plotWidth+=y;this.inverted?(this.clipBox.height+=y,this.plotBox.height+=y):(this.clipBox.width+=y,this.plotBox.width+=y);var I={1:{name:"right",value:y}}}}else v&&(this.scrollablePixelsY=y=Math.max(0,v-this.chartHeight))&&(this.plotHeight+=y,this.inverted?(this.clipBox.width+=y,this.plotBox.width+=y):(this.clipBox.height+=y,this.plotBox.height+= y),I={2:{name:"bottom",value:y}});I&&!g.skipAxes&&this.axes.forEach(function(g){I[g.side]?g.getPlotLinePath=function(){var y=I[g.side].name,D=this[y];this[y]=D-I[g.side].value;var z=k.Axis.prototype.getPlotLinePath.apply(this,arguments);this[y]=D;return z}:(g.setAxisSize(),g.setAxisTranslation())})}});H(g,"render",function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()});g.prototype.setUpScrolling=function(){var g= this,k={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(k.overflowX="auto");this.scrollablePixelsY&&(k.overflowY="auto");this.scrollingContainer=v("div",{className:"highcharts-scrolling"},k,this.renderTo);H(this.scrollingContainer,"scroll",function(){g.pointer&&delete g.pointer.chartPosition});this.innerContainer=v("div",{className:"highcharts-inner-container"},null,this.scrollingContainer);this.innerContainer.appendChild(this.container);this.setUpScrolling= null};g.prototype.moveFixedElements=function(){var g=this.container,k=this.fixedRenderer,y=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" "),v;this.scrollablePixelsX&&!this.inverted?v=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted?v=".highcharts-xaxis": this.scrollablePixelsY&&!this.inverted?v=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(v=".highcharts-yaxis");y.push(v,v+"-labels");y.forEach(function(y){[].forEach.call(g.querySelectorAll(y),function(g){(g.namespaceURI===k.SVG_NS?k.box:k.box.parentNode).appendChild(g);g.style.pointerEvents="auto"})})};g.prototype.applyFixed=function(){var g,M,y=!this.fixedDiv,I=this.options.chart.scrollablePlotArea;y?(this.fixedDiv=v("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden", pointerEvents:"none",zIndex:2},null,!0),this.renderTo.insertBefore(this.fixedDiv,this.renderTo.firstChild),this.renderTo.style.overflow="visible",this.fixedRenderer=M=new k.Renderer(this.fixedDiv,this.chartWidth,this.chartHeight,null===(g=this.options.chart)||void 0===g?void 0:g.style),this.scrollableMask=M.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":K(I.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),this.moveFixedElements(),H(this,"afterShowResetZoom", this.moveFixedElements),H(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight);g=this.chartWidth+(this.scrollablePixelsX||0);M=this.chartHeight+(this.scrollablePixelsY||0);G(this.container);this.container.style.width=g+"px";this.container.style.height=M+"px";this.renderer.boxWrapper.attr({width:g,height:M,viewBox:[0,0,g,M].join(" ")});this.chartBackground.attr({width:g,height:M});this.scrollingContainer.style.height=this.chartHeight+"px";y&& (I.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*I.scrollPositionX),I.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*I.scrollPositionY));M=this.axisOffset;y=this.plotTop-M[0]-1;I=this.plotLeft-M[3]-1;g=this.plotTop+this.plotHeight+M[2]+1;M=this.plotLeft+this.plotWidth+M[1]+1;var J=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),E=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);y=this.scrollablePixelsX?[["M",0,y],["L",this.plotLeft- 1,y],["L",this.plotLeft-1,g],["L",0,g],["Z"],["M",J,y],["L",this.chartWidth,y],["L",this.chartWidth,g],["L",J,g],["Z"]]:this.scrollablePixelsY?[["M",I,0],["L",I,this.plotTop-1],["L",M,this.plotTop-1],["L",M,0],["Z"],["M",I,E],["L",I,this.chartHeight],["L",M,this.chartHeight],["L",M,E],["Z"]]:[["M",0,0]];"adjustHeight"!==this.redrawTrigger&&this.scrollableMask.attr({d:y})}});P(A,"parts/StackingAxis.js",[A["parts/Utilities.js"]],function(k){var g=k.addEvent,H=k.destroyObjectProperties,v=k.fireEvent, K=k.objectEach,G=k.pick,N=function(){function g(g){this.oldStacks={};this.stacks={};this.stacksTouched=0;this.axis=g}g.prototype.buildStacks=function(){var g=this.axis,k=g.series,J=G(g.options.reversedStacks,!0),E=k.length,D;if(!g.isXAxis){this.usePercentage=!1;for(D=E;D--;){var z=k[J?D:E-D-1];z.setStackedPoints()}for(D=0;D<E;D++)k[D].modifyStacks();v(g,"afterBuildStacks")}};g.prototype.cleanStacks=function(){if(!this.axis.isXAxis){if(this.oldStacks)var g=this.stacks=this.oldStacks;K(g,function(g){K(g, function(g){g.cumulative=g.total})})}};g.prototype.resetStacks=function(){var g=this,k=g.stacks;g.axis.isXAxis||K(k,function(k){K(k,function(y,D){y.touched<g.stacksTouched?(y.destroy(),delete k[D]):(y.total=null,y.cumulative=null)})})};g.prototype.renderStackTotals=function(){var g=this.axis.chart,k=g.renderer,v=this.stacks,E=this.stackTotalGroup=this.stackTotalGroup||k.g("stack-labels").attr({visibility:"visible",zIndex:6}).add();E.translate(g.plotLeft,g.plotTop);K(v,function(g){K(g,function(g){g.render(E)})})}; return g}();return function(){function k(){}k.compose=function(y){g(y,"init",k.onInit);g(y,"destroy",k.onDestroy)};k.onDestroy=function(){var g=this.stacking;if(g){var k=g.stacks;K(k,function(g,y){H(g);k[y]=null});g&&g.stackTotalGroup&&g.stackTotalGroup.destroy()}};k.onInit=function(){this.stacking||(this.stacking=new N(this))};return k}()});P(A,"mixins/legend-symbol.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.merge,v=g.pick;k.LegendSymbolMixin={drawRectangle:function(g, k){var G=g.symbolHeight,M=g.options.squareSymbol;k.legendSymbol=this.chart.renderer.rect(M?(g.symbolWidth-G)/2:0,g.baseline-G+1,M?G:g.symbolWidth,G,v(g.options.symbolRadius,G/2)).addClass("highcharts-point").attr({zIndex:3}).add(k.legendGroup)},drawLineMarker:function(g){var k=this.options,N=k.marker,M=g.symbolWidth,y=g.symbolHeight,I=y/2,J=this.chart.renderer,E=this.legendGroup;g=g.baseline-Math.round(.3*g.fontMetrics.b);var D={};this.chart.styledMode||(D={"stroke-width":k.lineWidth||0},k.dashStyle&& (D.dashstyle=k.dashStyle));this.legendLine=J.path(["M",0,g,"L",M,g]).addClass("highcharts-graph").attr(D).add(E);N&&!1!==N.enabled&&M&&(k=Math.min(v(N.radius,I),I),0===this.symbol.indexOf("url")&&(N=H(N,{width:y,height:y}),k=0),this.legendSymbol=N=J.symbol(this.symbol,M/2-k,g-k,2*k,2*k,N).addClass("highcharts-point").add(E),N.isMarker=!0)}};return k.LegendSymbolMixin});P(A,"parts/Point.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){"";var H=g.animObject,v=g.defined,K=g.erase,G= g.extend,N=g.fireEvent,M=g.format,y=g.getNestedProperty,I=g.isArray,J=g.isNumber,E=g.isObject,D=g.syncTimeout,z=g.pick,t=g.removeEvent,q=g.uniqueKey;g=function(){function g(){this.colorIndex=this.category=void 0;this.formatPrefix="point";this.id=void 0;this.isNull=!1;this.percentage=this.options=this.name=void 0;this.selected=!1;this.total=this.series=void 0;this.visible=!0;this.x=void 0}g.prototype.animateBeforeDestroy=function(){var h=this,f={x:h.startXPos,opacity:0},a,l=h.getGraphicalProps();l.singular.forEach(function(e){a= "dataLabel"===e;h[e]=h[e].animate(a?{x:h[e].startXPos,y:h[e].startYPos,opacity:0}:f)});l.plural.forEach(function(a){h[a].forEach(function(a){a.element&&a.animate(G({x:h.startXPos},a.startYPos?{x:a.startXPos,y:a.startYPos}:{}))})})};g.prototype.applyOptions=function(h,f){var a=this.series,l=a.options.pointValKey||a.pointValKey;h=g.prototype.optionsToObject.call(this,h);G(this,h);this.options=this.options?G(this.options,h):h;h.group&&delete this.group;h.dataLabels&&delete this.dataLabels;l&&(this.y= g.prototype.getNestedProperty.call(this,l));this.formatPrefix=(this.isNull=z(this.isValid&&!this.isValid(),null===this.x||!J(this.y)))?"null":"point";this.selected&&(this.state="select");"name"in this&&"undefined"===typeof f&&a.xAxis&&a.xAxis.hasNames&&(this.x=a.xAxis.nameToX(this));"undefined"===typeof this.x&&a&&(this.x="undefined"===typeof f?a.autoIncrement(this):f);return this};g.prototype.destroy=function(){function h(){if(f.graphic||f.dataLabel||f.dataLabels)t(f),f.destroyElements();for(m in f)f[m]= null}var f=this,a=f.series,l=a.chart;a=a.options.dataSorting;var e=l.hoverPoints,c=H(f.series.chart.renderer.globalAnimation),m;f.legendItem&&l.legend.destroyItem(f);e&&(f.setState(),K(e,f),e.length||(l.hoverPoints=null));if(f===l.hoverPoint)f.onMouseOut();a&&a.enabled?(this.animateBeforeDestroy(),D(h,c.duration)):h();l.pointCount--};g.prototype.destroyElements=function(h){var f=this;h=f.getGraphicalProps(h);h.singular.forEach(function(a){f[a]=f[a].destroy()});h.plural.forEach(function(a){f[a].forEach(function(a){a.element&& a.destroy()});delete f[a]})};g.prototype.firePointEvent=function(h,f,a){var l=this,e=this.series.options;(e.point.events[h]||l.options&&l.options.events&&l.options.events[h])&&l.importEvents();"click"===h&&e.allowPointSelect&&(a=function(a){l.select&&l.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});N(l,h,f,a)};g.prototype.getClassName=function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+ ("undefined"!==typeof this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")};g.prototype.getGraphicalProps=function(h){var f=this,a=[],l,e={singular:[],plural:[]};h=h||{graphic:1,dataLabel:1};h.graphic&&a.push("graphic","shadowGroup");h.dataLabel&&a.push("dataLabel","dataLabelUpper","connector");for(l=a.length;l--;){var c=a[l];f[c]&&e.singular.push(c)}["dataLabel", "connector"].forEach(function(a){var c=a+"s";h[a]&&f[c]&&e.plural.push(c)});return e};g.prototype.getLabelConfig=function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}};g.prototype.getNestedProperty=function(h){if(h)return 0===h.indexOf("custom.")?y(h,this.options):this[h]};g.prototype.getZone=function(){var h=this.series,f=h.zones;h=h.zoneAxis|| "y";var a=0,l;for(l=f[a];this[h]>=l.value;)l=f[++a];this.nonZonedColor||(this.nonZonedColor=this.color);this.color=l&&l.color&&!this.options.color?l.color:this.nonZonedColor;return l};g.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType};g.prototype.init=function(h,f,a){this.series=h;this.applyOptions(f,a);this.id=v(this.id)?this.id:q();this.resolveColor();h.chart.pointCount++;N(this,"afterInit");return this};g.prototype.optionsToObject= function(h){var f={},a=this.series,l=a.options.keys,e=l||a.pointArrayMap||["y"],c=e.length,m=0,u=0;if(J(h)||null===h)f[e[0]]=h;else if(I(h))for(!l&&h.length>c&&(a=typeof h[0],"string"===a?f.name=h[0]:"number"===a&&(f.x=h[0]),m++);u<c;)l&&"undefined"===typeof h[m]||(0<e[u].indexOf(".")?g.prototype.setNestedProperty(f,h[m],e[u]):f[e[u]]=h[m]),m++,u++;else"object"===typeof h&&(f=h,h.dataLabels&&(a._hasPointLabels=!0),h.marker&&(a._hasPointMarkers=!0));return f};g.prototype.resolveColor=function(){var h= this.series;var f=h.chart.options.chart.colorCount;var a=h.chart.styledMode;delete this.nonZonedColor;a||this.options.color||(this.color=h.color);h.options.colorByPoint?(a||(f=h.options.colors||h.chart.options.colors,this.color=this.color||f[h.colorCounter],f=f.length),a=h.colorCounter,h.colorCounter++,h.colorCounter===f&&(h.colorCounter=0)):a=h.colorIndex;this.colorIndex=z(this.colorIndex,a)};g.prototype.setNestedProperty=function(h,f,a){a.split(".").reduce(function(a,e,c,h){a[e]=h.length-1===c? f:E(a[e],!0)?a[e]:{};return a[e]},h);return h};g.prototype.tooltipFormatter=function(h){var f=this.series,a=f.tooltipOptions,l=z(a.valueDecimals,""),e=a.valuePrefix||"",c=a.valueSuffix||"";f.chart.styledMode&&(h=f.chart.tooltip.styledModeFormat(h));(f.pointArrayMap||["y"]).forEach(function(a){a="{point."+a;if(e||c)h=h.replace(RegExp(a+"}","g"),e+a+"}"+c);h=h.replace(RegExp(a+"}","g"),a+":,."+l+"f}")});return M(h,{point:this,series:this.series},f.chart)};return g}();k.Point=g;return k.Point});P(A, "parts/Series.js",[A["mixins/legend-symbol.js"],A["parts/Globals.js"],A["parts/Point.js"],A["parts/Utilities.js"]],function(k,g,H,v){"";var K=v.addEvent,G=v.animObject,N=v.arrayMax,M=v.arrayMin,y=v.clamp,I=v.correctFloat,J=v.defined,E=v.erase,D=v.error,z=v.extend,t=v.find,q=v.fireEvent,r=v.getNestedProperty,h=v.isArray,f=v.isFunction,a=v.isNumber,l=v.isString,e=v.merge,c=v.objectEach,m=v.pick,u=v.removeEvent,L=v.seriesType,F=v.splat,w=v.syncTimeout,p=g.defaultOptions,C=g.defaultPlotOptions,O=g.seriesTypes, B=g.SVGElement,d=g.win;g.Series=L("line",null,{lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){var b=this.series.chart.numberFormatter;return"number"!==typeof this.y? "":b(this.y,-1)},padding:5,style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1E3,findNearestPointBy:"x"},{axisTypes:["xAxis","yAxis"],coll:"series", colorCounter:0,cropShoulder:1,directTouch:!1,eventsToUnbind:[],isCartesian:!0,parallelArrays:["x","y"],pointClass:H,requireSorting:!0,sorted:!0,init:function(b,a){q(this,"init",{options:a});var d=this,e=b.series,h;this.eventOptions=this.eventOptions||{};d.chart=b;d.options=a=d.setOptions(a);d.linkedSeries=[];d.bindAxes();z(d,{name:a.name,state:"",visible:!1!==a.visible,selected:!0===a.selected});var n=a.events;c(n,function(b,a){f(b)&&d.eventOptions[a]!==b&&(f(d.eventOptions[a])&&u(d,a,d.eventOptions[a]), d.eventOptions[a]=b,K(d,a,b))});if(n&&n.click||a.point&&a.point.events&&a.point.events.click||a.allowPointSelect)b.runTrackerClick=!0;d.getColor();d.getSymbol();d.parallelArrays.forEach(function(b){d[b+"Data"]||(d[b+"Data"]=[])});d.isCartesian&&(b.hasCartesianSeries=!0);e.length&&(h=e[e.length-1]);d._i=m(h&&h._i,-1)+1;b.orderSeries(this.insert(e));a.dataSorting&&a.dataSorting.enabled?d.setDataSortingOptions():d.points||d.data||d.setData(a.data,!1);q(this,"afterInit")},is:function(b){return O[b]&& this instanceof O[b]},insert:function(b){var d=this.options.index,c;if(a(d)){for(c=b.length;c--;)if(d>=m(b[c].options.index,b[c]._i)){b.splice(c+1,0,this);break}-1===c&&b.unshift(this);c+=1}else b.push(this);return m(c,b.length-1)},bindAxes:function(){var b=this,a=b.options,d=b.chart,c;q(this,"bindAxes",null,function(){(b.axisTypes||[]).forEach(function(e){d[e].forEach(function(d){c=d.options;if(a[e]===c.index||"undefined"!==typeof a[e]&&a[e]===c.id||"undefined"===typeof a[e]&&0===c.index)b.insert(d.series), b[e]=d,d.isDirty=!0});b[e]||b.optionalAxis===e||D(18,!0,d)})});q(this,"afterBindAxes")},updateParallelArrays:function(b,d){var c=b.series,e=arguments,f=a(d)?function(a){var e="y"===a&&c.toYData?c.toYData(b):b[a];c[a+"Data"][d]=e}:function(b){Array.prototype[d].apply(c[b+"Data"],Array.prototype.slice.call(e,2))};c.parallelArrays.forEach(f)},hasData:function(){return this.visible&&"undefined"!==typeof this.dataMax&&"undefined"!==typeof this.dataMin||this.visible&&this.yData&&0<this.yData.length},autoIncrement:function(){var b= this.options,a=this.xIncrement,d,c=b.pointIntervalUnit,e=this.chart.time;a=m(a,b.pointStart,0);this.pointInterval=d=m(this.pointInterval,b.pointInterval,1);c&&(b=new e.Date(a),"day"===c?e.set("Date",b,e.get("Date",b)+d):"month"===c?e.set("Month",b,e.get("Month",b)+d):"year"===c&&e.set("FullYear",b,e.get("FullYear",b)+d),d=b.getTime()-a);this.xIncrement=a+d;return a},setDataSortingOptions:function(){var b=this.options;z(this,{requireSorting:!1,sorted:!1,enabledDataSorting:!0,allowDG:!1});J(b.pointRange)|| (b.pointRange=1)},setOptions:function(b){var a=this.chart,d=a.options,c=d.plotOptions,f=a.userOptions||{};b=e(b);a=a.styledMode;var h={plotOptions:c,userOptions:b};q(this,"setOptions",h);var l=h.plotOptions[this.type],u=f.plotOptions||{};this.userOptions=h.userOptions;f=e(l,c.series,f.plotOptions&&f.plotOptions[this.type],b);this.tooltipOptions=e(p.tooltip,p.plotOptions.series&&p.plotOptions.series.tooltip,p.plotOptions[this.type].tooltip,d.tooltip.userOptions,c.series&&c.series.tooltip,c[this.type].tooltip, b.tooltip);this.stickyTracking=m(b.stickyTracking,u[this.type]&&u[this.type].stickyTracking,u.series&&u.series.stickyTracking,this.tooltipOptions.shared&&!this.noSharedTooltip?!0:f.stickyTracking);null===l.marker&&delete f.marker;this.zoneAxis=f.zoneAxis;d=this.zones=(f.zones||[]).slice();!f.negativeColor&&!f.negativeFillColor||f.zones||(c={value:f[this.zoneAxis+"Threshold"]||f.threshold||0,className:"highcharts-negative"},a||(c.color=f.negativeColor,c.fillColor=f.negativeFillColor),d.push(c));d.length&& J(d[d.length-1].value)&&d.push(a?{}:{color:this.color,fillColor:this.fillColor});q(this,"afterSetOptions",{options:f});return f},getName:function(){return m(this.options.name,"Series "+(this.index+1))},getCyclic:function(b,a,d){var c=this.chart,e=this.userOptions,f=b+"Index",h=b+"Counter",n=d?d.length:m(c.options.chart[b+"Count"],c[b+"Count"]);if(!a){var p=m(e[f],e["_"+f]);J(p)||(c.series.length||(c[h]=0),e["_"+f]=p=c[h]%n,c[h]+=1);d&&(a=d[p])}"undefined"!==typeof p&&(this[f]=p);this[b]=a},getColor:function(){this.chart.styledMode? this.getCyclic("color"):this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||C[this.type].color,this.chart.options.colors)},getPointsCollection:function(){return(this.hasGroupedData?this.points:this.data)||[]},getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol,this.chart.options.symbols)},findPointIndex:function(b,d){var c=b.id,e=b.x,f=this.points,h,n=this.options.dataSorting;if(c)var p=this.chart.get(c);else if(this.linkedParent||this.enabledDataSorting){var l= n&&n.matchByName?"name":"index";p=t(f,function(a){return!a.touched&&a[l]===b[l]});if(!p)return}if(p){var m=p&&p.index;"undefined"!==typeof m&&(h=!0)}"undefined"===typeof m&&a(e)&&(m=this.xData.indexOf(e,d));-1!==m&&"undefined"!==typeof m&&this.cropped&&(m=m>=this.cropStart?m-this.cropStart:m);!h&&f[m]&&f[m].touched&&(m=void 0);return m},drawLegendSymbol:k.drawLineMarker,updateData:function(b,d){var c=this.options,e=c.dataSorting,f=this.points,h=[],n,p,m,l=this.requireSorting,u=b.length===f.length, w=!0;this.xIncrement=null;b.forEach(function(b,d){var p=J(b)&&this.pointClass.prototype.optionsToObject.call({series:this},b)||{};var w=p.x;if(p.id||a(w)){if(w=this.findPointIndex(p,m),-1===w||"undefined"===typeof w?h.push(b):f[w]&&b!==c.data[w]?(f[w].update(b,!1,null,!1),f[w].touched=!0,l&&(m=w+1)):f[w]&&(f[w].touched=!0),!u||d!==w||e&&e.enabled||this.hasDerivedData)n=!0}else h.push(b)},this);if(n)for(b=f.length;b--;)(p=f[b])&&!p.touched&&p.remove&&p.remove(!1,d);else!u||e&&e.enabled?w=!1:(b.forEach(function(b, a){f[a].update&&b!==f[a].y&&f[a].update(b,!1,null,!1)}),h.length=0);f.forEach(function(b){b&&(b.touched=!1)});if(!w)return!1;h.forEach(function(b){this.addPoint(b,!1,null,null,!1)},this);null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=N(this.xData),this.autoIncrement());return!0},setData:function(b,d,c,e){var f=this,n=f.points,p=n&&n.length||0,u,w=f.options,x=f.chart,C=w.dataSorting,g=null,r=f.xAxis;g=w.turboThreshold;var F=this.xData,q=this.yData,t=(u=f.pointArrayMap)&&u.length, B=w.keys,k=0,O=1,z;b=b||[];u=b.length;d=m(d,!0);C&&C.enabled&&(b=this.sortData(b));!1!==e&&u&&p&&!f.cropped&&!f.hasGroupedData&&f.visible&&!f.isSeriesBoosting&&(z=this.updateData(b,c));if(!z){f.xIncrement=null;f.colorCounter=0;this.parallelArrays.forEach(function(b){f[b+"Data"].length=0});if(g&&u>g)if(g=f.getFirstValidPoint(b),a(g))for(c=0;c<u;c++)F[c]=this.autoIncrement(),q[c]=b[c];else if(h(g))if(t)for(c=0;c<u;c++)e=b[c],F[c]=e[0],q[c]=e.slice(1,t+1);else for(B&&(k=B.indexOf("x"),O=B.indexOf("y"), k=0<=k?k:0,O=0<=O?O:1),c=0;c<u;c++)e=b[c],F[c]=e[k],q[c]=e[O];else D(12,!1,x);else for(c=0;c<u;c++)"undefined"!==typeof b[c]&&(e={series:f},f.pointClass.prototype.applyOptions.apply(e,[b[c]]),f.updateParallelArrays(e,c));q&&l(q[0])&&D(14,!0,x);f.data=[];f.options.data=f.userOptions.data=b;for(c=p;c--;)n[c]&&n[c].destroy&&n[c].destroy();r&&(r.minRange=r.userMinRange);f.isDirty=x.isDirtyBox=!0;f.isDirtyData=!!n;c=!1}"point"===w.legendType&&(this.processData(),this.generatePoints());d&&x.redraw(c)}, sortData:function(b){var a=this,d=a.options.dataSorting.sortKey||"y",c=function(b,a){return J(a)&&b.pointClass.prototype.optionsToObject.call({series:b},a)||{}};b.forEach(function(d,e){b[e]=c(a,d);b[e].index=e},this);b.concat().sort(function(b,a){b=r(d,b);a=r(d,a);return a<b?-1:a>b?1:0}).forEach(function(b,a){b.x=a},this);a.linkedSeries&&a.linkedSeries.forEach(function(a){var d=a.options,e=d.data;d.dataSorting&&d.dataSorting.enabled||!e||(e.forEach(function(d,f){e[f]=c(a,d);b[f]&&(e[f].x=b[f].x,e[f].index= f)}),a.setData(e,!1))});return b},getProcessedData:function(b){var a=this.xData,d=this.yData,c=a.length;var e=0;var f=this.xAxis,h=this.options;var p=h.cropThreshold;var m=b||this.getExtremesFromAll||h.getExtremesFromAll,l=this.isCartesian;b=f&&f.val2lin;h=!(!f||!f.logarithmic);var u=this.requireSorting;if(f){f=f.getExtremes();var w=f.min;var C=f.max}if(l&&this.sorted&&!m&&(!p||c>p||this.forceCrop))if(a[c-1]<w||a[0]>C)a=[],d=[];else if(this.yData&&(a[0]<w||a[c-1]>C)){e=this.cropData(this.xData,this.yData, w,C);a=e.xData;d=e.yData;e=e.start;var g=!0}for(p=a.length||1;--p;)if(c=h?b(a[p])-b(a[p-1]):a[p]-a[p-1],0<c&&("undefined"===typeof r||c<r))var r=c;else 0>c&&u&&(D(15,!1,this.chart),u=!1);return{xData:a,yData:d,cropped:g,cropStart:e,closestPointRange:r}},processData:function(b){var a=this.xAxis;if(this.isCartesian&&!this.isDirty&&!a.isDirty&&!this.yAxis.isDirty&&!b)return!1;b=this.getProcessedData();this.cropped=b.cropped;this.cropStart=b.cropStart;this.processedXData=b.xData;this.processedYData=b.yData; this.closestPointRange=this.basePointRange=b.closestPointRange},cropData:function(b,a,d,c,e){var f=b.length,h=0,n=f,p;e=m(e,this.cropShoulder);for(p=0;p<f;p++)if(b[p]>=d){h=Math.max(0,p-e);break}for(d=p;d<f;d++)if(b[d]>c){n=d+e;break}return{xData:b.slice(h,n),yData:a.slice(h,n),start:h,end:n}},generatePoints:function(){var b=this.options,a=b.data,d=this.data,c,e=this.processedXData,f=this.processedYData,h=this.pointClass,p=e.length,m=this.cropStart||0,l=this.hasGroupedData;b=b.keys;var u=[],w;d|| l||(d=[],d.length=a.length,d=this.data=d);b&&l&&(this.options.keys=!1);for(w=0;w<p;w++){var C=m+w;if(l){var g=(new h).init(this,[e[w]].concat(F(f[w])));g.dataGroup=this.groupMap[w];g.dataGroup.options&&(g.options=g.dataGroup.options,z(g,g.dataGroup.options),delete g.dataLabels)}else(g=d[C])||"undefined"===typeof a[C]||(d[C]=g=(new h).init(this,a[C],e[w]));g&&(g.index=C,u[w]=g)}this.options.keys=b;if(d&&(p!==(c=d.length)||l))for(w=0;w<c;w++)w!==m||l||(w+=p),d[w]&&(d[w].destroyElements(),d[w].plotX= void 0);this.data=d;this.points=u;q(this,"afterGeneratePoints")},getXExtremes:function(b){return{min:M(b),max:N(b)}},getExtremes:function(b,d){var c=this.xAxis,e=this.yAxis,f=this.processedXData||this.xData,n=[],p=0,m=0;var l=0;var u=this.requireSorting?this.cropShoulder:0,w=e?e.positiveValuesOnly:!1,C;b=b||this.stackedYData||this.processedYData||[];e=b.length;c&&(l=c.getExtremes(),m=l.min,l=l.max);for(C=0;C<e;C++){var g=f[C];var r=b[C];var F=(a(r)||h(r))&&(r.length||0<r||!w);g=d||this.getExtremesFromAll|| this.options.getExtremesFromAll||this.cropped||!c||(f[C+u]||g)>=m&&(f[C-u]||g)<=l;if(F&&g)if(F=r.length)for(;F--;)a(r[F])&&(n[p++]=r[F]);else n[p++]=r}b={dataMin:M(n),dataMax:N(n)};q(this,"afterGetExtremes",{dataExtremes:b});return b},applyExtremes:function(){var b=this.getExtremes();this.dataMin=b.dataMin;this.dataMax=b.dataMax;return b},getFirstValidPoint:function(b){for(var a=null,d=b.length,c=0;null===a&&c<d;)a=b[c],c++;return a},translate:function(){this.processedXData||this.processData();this.generatePoints(); var b=this.options,d=b.stacking,c=this.xAxis,e=c.categories,f=this.enabledDataSorting,p=this.yAxis,l=this.points,u=l.length,w=!!this.modifyValue,C,g=this.pointPlacementToXValue(),r=!!g,F=b.threshold,t=b.startFromThreshold?F:0,B,k=this.zoneAxis||"y",O=Number.MAX_VALUE;for(C=0;C<u;C++){var z=l[C],L=z.x,D=z.y,v=z.low,E=d&&p.stacking&&p.stacking.stacks[(this.negStacks&&D<(t?0:F)?"-":"")+this.stackKey];p.positiveValuesOnly&&null!==D&&0>=D&&(z.isNull=!0);z.plotX=B=I(y(c.translate(L,0,0,0,1,g,"flags"=== this.type),-1E5,1E5));if(d&&this.visible&&E&&E[L]){var G=this.getStackIndicator(G,L,this.index);if(!z.isNull){var M=E[L];var H=M.points[G.key]}}h(H)&&(v=H[0],D=H[1],v===t&&G.key===E[L].base&&(v=m(a(F)&&F,p.min)),p.positiveValuesOnly&&0>=v&&(v=null),z.total=z.stackTotal=M.total,z.percentage=M.total&&z.y/M.total*100,z.stackY=D,this.irregularWidths||M.setOffset(this.pointXOffset||0,this.barW||0));z.yBottom=J(v)?y(p.translate(v,0,1,0,1),-1E5,1E5):null;w&&(D=this.modifyValue(D,z));z.plotY="number"===typeof D&& Infinity!==D?y(p.translate(D,0,1,0,1),-1E5,1E5):void 0;z.isInside=this.isPointInside(z);z.clientX=r?I(c.translate(L,0,0,0,1,g)):B;z.negative=z[k]<(b[k+"Threshold"]||F||0);z.category=e&&"undefined"!==typeof e[z.x]?e[z.x]:z.x;if(!z.isNull&&!1!==z.visible){"undefined"!==typeof N&&(O=Math.min(O,Math.abs(B-N)));var N=B}z.zone=this.zones.length&&z.getZone();!z.graphic&&this.group&&f&&(z.isNew=!0)}this.closestPointRangePx=O;q(this,"afterTranslate")},getValidPoints:function(b,a,d){var c=this.chart;return(b|| this.points||[]).filter(function(b){return a&&!c.isInsidePlot(b.plotX,b.plotY,c.inverted)?!1:!1!==b.visible&&(d||!b.isNull)})},getClipBox:function(b,a){var d=this.options,c=this.chart,e=c.inverted,f=this.xAxis,h=f&&this.yAxis;b&&!1===d.clip&&h?b=e?{y:-c.chartWidth+h.len+h.pos,height:c.chartWidth,width:c.chartHeight,x:-c.chartHeight+f.len+f.pos}:{y:-h.pos,height:c.chartHeight,width:c.chartWidth,x:-f.pos}:(b=this.clipBox||c.clipBox,a&&(b.width=c.plotSizeX,b.x=0));return a?{width:b.width,x:b.x}:b},setClip:function(b){var a= this.chart,d=this.options,c=a.renderer,e=a.inverted,f=this.clipBox,h=this.getClipBox(b),p=this.sharedClipKey||["_sharedClip",b&&b.duration,b&&b.easing,h.height,d.xAxis,d.yAxis].join(),m=a[p],l=a[p+"m"];b&&(h.width=0,e&&(h.x=a.plotHeight+(!1!==d.clip?0:a.plotTop)));m?a.hasLoaded||m.attr(h):(b&&(a[p+"m"]=l=c.clipRect(e?a.plotSizeX+99:-99,e?-a.plotLeft:-a.plotTop,99,e?a.chartWidth:a.chartHeight)),a[p]=m=c.clipRect(h),m.count={length:0});b&&!m.count[this.index]&&(m.count[this.index]=!0,m.count.length+= 1);if(!1!==d.clip||b)this.group.clip(b||f?m:a.clipRect),this.markerGroup.clip(l),this.sharedClipKey=p;b||(m.count[this.index]&&(delete m.count[this.index],--m.count.length),0===m.count.length&&p&&a[p]&&(f||(a[p]=a[p].destroy()),a[p+"m"]&&(a[p+"m"]=a[p+"m"].destroy())))},animate:function(b){var a=this.chart,d=G(this.options.animation);if(!a.hasRendered)if(b)this.setClip(d);else{var c=this.sharedClipKey;b=a[c];var e=this.getClipBox(d,!0);b&&b.animate(e,d);a[c+"m"]&&a[c+"m"].animate({width:e.width+99, x:e.x-(a.inverted?0:99)},d)}},afterAnimate:function(){this.setClip();q(this,"afterAnimate");this.finishedAnimating=!0},drawPoints:function(){var b=this.points,a=this.chart,d,c,e=this.options.marker,f=this[this.specialGroup]||this.markerGroup,h=this.xAxis,p=m(e.enabled,!h||h.isRadial?!0:null,this.closestPointRangePx>=e.enabledThreshold*e.radius);if(!1!==e.enabled||this._hasPointMarkers)for(d=0;d<b.length;d++){var l=b[d];var u=(c=l.graphic)?"animate":"attr";var w=l.marker||{};var C=!!l.marker;if((p&& "undefined"===typeof w.enabled||w.enabled)&&!l.isNull&&!1!==l.visible){var g=m(w.symbol,this.symbol);var r=this.markerAttribs(l,l.selected&&"select");this.enabledDataSorting&&(l.startXPos=h.reversed?-r.width:h.width);var F=!1!==l.isInside;c?c[F?"show":"hide"](F).animate(r):F&&(0<r.width||l.hasImage)&&(l.graphic=c=a.renderer.symbol(g,r.x,r.y,r.width,r.height,C?w:e).add(f),this.enabledDataSorting&&a.hasRendered&&(c.attr({x:l.startXPos}),u="animate"));c&&"animate"===u&&c[F?"show":"hide"](F).animate(r); if(c&&!a.styledMode)c[u](this.pointAttribs(l,l.selected&&"select"));c&&c.addClass(l.getClassName(),!0)}else c&&(l.graphic=c.destroy())}},markerAttribs:function(b,a){var d=this.options,c=d.marker,e=b.marker||{},f=e.symbol||c.symbol,h=m(e.radius,c.radius);a&&(c=c.states[a],a=e.states&&e.states[a],h=m(a&&a.radius,c&&c.radius,h+(c&&c.radiusPlus||0)));b.hasImage=f&&0===f.indexOf("url");b.hasImage&&(h=0);b={x:d.crisp?Math.floor(b.plotX)-h:b.plotX-h,y:b.plotY-h};h&&(b.width=b.height=2*h);return b},pointAttribs:function(b, a){var d=this.options.marker,c=b&&b.options,e=c&&c.marker||{},f=this.color,h=c&&c.color,p=b&&b.color;c=m(e.lineWidth,d.lineWidth);var n=b&&b.zone&&b.zone.color;b=1;f=h||n||p||f;h=e.fillColor||d.fillColor||f;f=e.lineColor||d.lineColor||f;a=a||"normal";d=d.states[a];a=e.states&&e.states[a]||{};c=m(a.lineWidth,d.lineWidth,c+m(a.lineWidthPlus,d.lineWidthPlus,0));h=a.fillColor||d.fillColor||h;f=a.lineColor||d.lineColor||f;b=m(a.opacity,d.opacity,b);return{stroke:f,"stroke-width":c,fill:h,opacity:b}},destroy:function(b){var a= this,e=a.chart,f=/AppleWebKit\/533/.test(d.navigator.userAgent),h,p,l=a.data||[],m,u;q(a,"destroy");this.removeEvents(b);(a.axisTypes||[]).forEach(function(b){(u=a[b])&&u.series&&(E(u.series,a),u.isDirty=u.forceRedraw=!0)});a.legendItem&&a.chart.legend.destroyItem(a);for(p=l.length;p--;)(m=l[p])&&m.destroy&&m.destroy();a.points=null;v.clearTimeout(a.animationTimeout);c(a,function(b,a){b instanceof B&&!b.survive&&(h=f&&"group"===a?"hide":"destroy",b[h]())});e.hoverSeries===a&&(e.hoverSeries=null); E(e.series,a);e.orderSeries();c(a,function(d,c){b&&"hcEvents"===c||delete a[c]})},getGraphPath:function(b,a,d){var c=this,e=c.options,f=e.step,h,p=[],n=[],l;b=b||c.points;(h=b.reversed)&&b.reverse();(f={right:1,center:2}[f]||f&&3)&&h&&(f=4-f);b=this.getValidPoints(b,!1,!(e.connectNulls&&!a&&!d));b.forEach(function(h,m){var u=h.plotX,w=h.plotY,C=b[m-1];(h.leftCliff||C&&C.rightCliff)&&!d&&(l=!0);h.isNull&&!J(a)&&0<m?l=!e.connectNulls:h.isNull&&!a?l=!0:(0===m||l?m=[["M",h.plotX,h.plotY]]:c.getPointSpline? m=[c.getPointSpline(b,h,m)]:f?(m=1===f?[["L",C.plotX,w]]:2===f?[["L",(C.plotX+u)/2,C.plotY],["L",(C.plotX+u)/2,w]]:[["L",u,C.plotY]],m.push(["L",u,w])):m=[["L",u,w]],n.push(h.x),f&&(n.push(h.x),2===f&&n.push(h.x)),p.push.apply(p,m),l=!1)});p.xMap=n;return c.graphPath=p},drawGraph:function(){var b=this,a=this.options,d=(this.gappedPath||this.getGraphPath).call(this),c=this.chart.styledMode,e=[["graph","highcharts-graph"]];c||e[0].push(a.lineColor||this.color||"#cccccc",a.dashStyle);e=b.getZonesGraphs(e); e.forEach(function(e,f){var h=e[0],p=b[h],n=p?"animate":"attr";p?(p.endX=b.preventGraphAnimation?null:d.xMap,p.animate({d:d})):d.length&&(b[h]=p=b.chart.renderer.path(d).addClass(e[1]).attr({zIndex:1}).add(b.group));p&&!c&&(h={stroke:e[2],"stroke-width":a.lineWidth,fill:b.fillGraph&&b.color||"none"},e[3]?h.dashstyle=e[3]:"square"!==a.linecap&&(h["stroke-linecap"]=h["stroke-linejoin"]="round"),p[n](h).shadow(2>f&&a.shadow));p&&(p.startX=d.xMap,p.isArea=d.isArea)})},getZonesGraphs:function(b){this.zones.forEach(function(a, d){d=["zone-graph-"+d,"highcharts-graph highcharts-zone-graph-"+d+" "+(a.className||"")];this.chart.styledMode||d.push(a.color||this.color,a.dashStyle||this.options.dashStyle);b.push(d)},this);return b},applyZones:function(){var b=this,a=this.chart,d=a.renderer,c=this.zones,e,f,h=this.clips||[],p,l=this.graph,u=this.area,w=Math.max(a.chartWidth,a.chartHeight),C=this[(this.zoneAxis||"y")+"Axis"],g=a.inverted,r,F,q,t=!1,B,k;if(c.length&&(l||u)&&C&&"undefined"!==typeof C.min){var z=C.reversed;var O= C.horiz;l&&!this.showLine&&l.hide();u&&u.hide();var L=C.getExtremes();c.forEach(function(c,n){e=z?O?a.plotWidth:0:O?0:C.toPixels(L.min)||0;e=y(m(f,e),0,w);f=y(Math.round(C.toPixels(m(c.value,L.max),!0)||0),0,w);t&&(e=f=C.toPixels(L.max));r=Math.abs(e-f);F=Math.min(e,f);q=Math.max(e,f);C.isXAxis?(p={x:g?q:F,y:0,width:r,height:w},O||(p.x=a.plotHeight-p.x)):(p={x:0,y:g?q:F,width:w,height:r},O&&(p.y=a.plotWidth-p.y));g&&d.isVML&&(p=C.isXAxis?{x:0,y:z?F:q,height:p.width,width:a.chartWidth}:{x:p.y-a.plotLeft- a.spacingBox.x,y:0,width:p.height,height:a.chartHeight});h[n]?h[n].animate(p):h[n]=d.clipRect(p);B=b["zone-area-"+n];k=b["zone-graph-"+n];l&&k&&k.clip(h[n]);u&&B&&B.clip(h[n]);t=c.value>L.max;b.resetZones&&0===f&&(f=void 0)});this.clips=h}else b.visible&&(l&&l.show(!0),u&&u.show(!0))},invertGroups:function(b){function a(){["group","markerGroup"].forEach(function(a){d[a]&&(c.renderer.isVML&&d[a].attr({width:d.yAxis.len,height:d.xAxis.len}),d[a].width=d.yAxis.len,d[a].height=d.xAxis.len,d[a].invert(d.isRadialSeries? !1:b))})}var d=this,c=d.chart;d.xAxis&&(d.eventsToUnbind.push(K(c,"resize",a)),a(),d.invertGroups=a)},plotGroup:function(b,a,d,c,e){var f=this[b],h=!f;h&&(this[b]=f=this.chart.renderer.g().attr({zIndex:c||.1}).add(e));f.addClass("highcharts-"+a+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(J(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(f.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0);f.attr({visibility:d})[h?"attr": "animate"](this.getPlotBox());return f},getPlotBox:function(){var b=this.chart,a=this.xAxis,d=this.yAxis;b.inverted&&(a=d,d=this.xAxis);return{translateX:a?a.left:b.plotLeft,translateY:d?d.top:b.plotTop,scaleX:1,scaleY:1}},removeEvents:function(b){b?this.eventsToUnbind.length&&(this.eventsToUnbind.forEach(function(b){b()}),this.eventsToUnbind.length=0):u(this)},render:function(){var b=this,a=b.chart,d=b.options,c=!b.finishedAnimating&&a.renderer.isSVG&&G(d.animation).duration,e=b.visible?"inherit": "hidden",f=d.zIndex,h=b.hasRendered,p=a.seriesGroup,l=a.inverted;q(this,"render");var m=b.plotGroup("group","series",e,f,p);b.markerGroup=b.plotGroup("markerGroup","markers",e,f,p);c&&b.animate&&b.animate(!0);m.inverted=b.isCartesian||b.invertable?l:!1;b.drawGraph&&(b.drawGraph(),b.applyZones());b.visible&&b.drawPoints();b.drawDataLabels&&b.drawDataLabels();b.redrawPoints&&b.redrawPoints();b.drawTracker&&!1!==b.options.enableMouseTracking&&b.drawTracker();b.invertGroups(l);!1===d.clip||b.sharedClipKey|| h||m.clip(a.clipRect);c&&b.animate&&b.animate();h||(b.animationTimeout=w(function(){b.afterAnimate()},c||0));b.isDirty=!1;b.hasRendered=!0;q(b,"afterRender")},redraw:function(){var b=this.chart,a=this.isDirty||this.isDirtyData,d=this.group,c=this.xAxis,e=this.yAxis;d&&(b.inverted&&d.attr({width:b.plotWidth,height:b.plotHeight}),d.animate({translateX:m(c&&c.left,b.plotLeft),translateY:m(e&&e.top,b.plotTop)}));this.translate();this.render();a&&delete this.kdTree},kdAxisArray:["clientX","plotY"],searchPoint:function(b, a){var d=this.xAxis,c=this.yAxis,e=this.chart.inverted;return this.searchKDTree({clientX:e?d.len-b.chartY+d.pos:b.chartX-d.pos,plotY:e?c.len-b.chartX+c.pos:b.chartY-c.pos},a,b)},buildKDTree:function(b){function a(b,c,e){var f;if(f=b&&b.length){var h=d.kdAxisArray[c%e];b.sort(function(b,a){return b[h]-a[h]});f=Math.floor(f/2);return{point:b[f],left:a(b.slice(0,f),c+1,e),right:a(b.slice(f+1),c+1,e)}}}this.buildingKdTree=!0;var d=this,c=-1<d.options.findNearestPointBy.indexOf("y")?2:1;delete d.kdTree; w(function(){d.kdTree=a(d.getValidPoints(null,!d.directTouch),c,c);d.buildingKdTree=!1},d.options.kdNow||b&&"touchstart"===b.type?0:1)},searchKDTree:function(b,a,d){function c(b,a,d,n){var l=a.point,m=e.kdAxisArray[d%n],u=l;var w=J(b[f])&&J(l[f])?Math.pow(b[f]-l[f],2):null;var C=J(b[h])&&J(l[h])?Math.pow(b[h]-l[h],2):null;C=(w||0)+(C||0);l.dist=J(C)?Math.sqrt(C):Number.MAX_VALUE;l.distX=J(w)?Math.sqrt(w):Number.MAX_VALUE;m=b[m]-l[m];C=0>m?"left":"right";w=0>m?"right":"left";a[C]&&(C=c(b,a[C],d+1, n),u=C[p]<u[p]?C:l);a[w]&&Math.sqrt(m*m)<u[p]&&(b=c(b,a[w],d+1,n),u=b[p]<u[p]?b:u);return u}var e=this,f=this.kdAxisArray[0],h=this.kdAxisArray[1],p=a?"distX":"dist";a=-1<e.options.findNearestPointBy.indexOf("y")?2:1;this.kdTree||this.buildingKdTree||this.buildKDTree(d);if(this.kdTree)return c(b,this.kdTree,a,a)},pointPlacementToXValue:function(){var b=this.options,d=b.pointRange,c=this.xAxis;b=b.pointPlacement;"between"===b&&(b=c.reversed?-.5:.5);return a(b)?b*m(d,c.pointRange):0},isPointInside:function(b){return"undefined"!== typeof b.plotY&&"undefined"!==typeof b.plotX&&0<=b.plotY&&b.plotY<=this.yAxis.len&&0<=b.plotX&&b.plotX<=this.xAxis.len}});""});P(A,"parts/Stacking.js",[A["parts/Axis.js"],A["parts/Globals.js"],A["parts/StackingAxis.js"],A["parts/Utilities.js"]],function(k,g,H,v){var K=v.correctFloat,G=v.defined,N=v.destroyObjectProperties,M=v.format,y=v.pick;"";v=g.Chart;var I=g.Series,J=function(){function g(g,k,t,q,r){var h=g.chart.inverted;this.axis=g;this.isNegative=t;this.options=k=k||{};this.x=q;this.total= null;this.points={};this.stack=r;this.rightCliff=this.leftCliff=0;this.alignOptions={align:k.align||(h?t?"left":"right":"center"),verticalAlign:k.verticalAlign||(h?"middle":t?"bottom":"top"),y:k.y,x:k.x};this.textAlign=k.textAlign||(h?t?"right":"left":"center")}g.prototype.destroy=function(){N(this,this.axis)};g.prototype.render=function(g){var k=this.axis.chart,t=this.options,q=t.format;q=q?M(q,this,k):t.formatter.call(this);this.label?this.label.attr({text:q,visibility:"hidden"}):(this.label=k.renderer.label(q, null,null,t.shape,null,null,t.useHTML,!1,"stack-labels"),q={r:t.borderRadius||0,text:q,rotation:t.rotation,padding:y(t.padding,5),visibility:"hidden"},k.styledMode||(q.fill=t.backgroundColor,q.stroke=t.borderColor,q["stroke-width"]=t.borderWidth,this.label.css(t.style)),this.label.attr(q),this.label.added||this.label.add(g));this.label.labelrank=k.plotHeight};g.prototype.setOffset=function(g,k,t,q,r){var h=this.axis,f=h.chart;q=h.translate(h.stacking.usePercentage?100:q?q:this.total,0,0,0,1);t=h.translate(t? t:0);t=G(q)&&Math.abs(q-t);g=y(r,f.xAxis[0].translate(this.x))+g;h=G(q)&&this.getStackBox(f,this,g,q,k,t,h);k=this.label;t=this.isNegative;g="justify"===y(this.options.overflow,"justify");var a=this.textAlign;k&&h&&(r=k.getBBox(),q=k.padding,a="left"===a?f.inverted?-q:q:"right"===a?r.width:f.inverted&&"center"===a?r.width/2:f.inverted?t?r.width+q:-q:r.width/2,t=f.inverted?r.height/2:t?-q:r.height,this.alignOptions.x=y(this.options.x,0),this.alignOptions.y=y(this.options.y,0),h.x-=a,h.y-=t,k.align(this.alignOptions, null,h),f.isInsidePlot(k.alignAttr.x+a-this.alignOptions.x,k.alignAttr.y+t-this.alignOptions.y)?k.show():(k.alignAttr.y=-9999,g=!1),g&&I.prototype.justifyDataLabel.call(this.axis,k,this.alignOptions,k.alignAttr,r,h),k.attr({x:k.alignAttr.x,y:k.alignAttr.y}),y(!g&&this.options.crop,!0)&&((f=f.isInsidePlot(k.x-q+k.width,k.y)&&f.isInsidePlot(k.x+q,k.y))||k.hide()))};g.prototype.getStackBox=function(g,k,t,q,r,h,f){var a=k.axis.reversed,l=g.inverted,e=f.height+f.pos-(l?g.plotLeft:g.plotTop);k=k.isNegative&& !a||!k.isNegative&&a;return{x:l?k?q-f.right:q-h+f.pos-g.plotLeft:t+g.xAxis[0].transB-g.plotLeft,y:l?f.height-t-r:k?e-q-h:e-q,width:l?h:r,height:l?r:h}};return g}();v.prototype.getStacks=function(){var g=this,k=g.inverted;g.yAxis.forEach(function(g){g.stacking&&g.stacking.stacks&&g.hasVisibleSeries&&(g.stacking.oldStacks=g.stacking.stacks)});g.series.forEach(function(z){var t=z.xAxis&&z.xAxis.options||{};!z.options.stacking||!0!==z.visible&&!1!==g.options.chart.ignoreHiddenSeries||(z.stackKey=[z.type, y(z.options.stack,""),k?t.top:t.left,k?t.height:t.width].join())})};H.compose(k);I.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var g=this.processedXData,k=this.processedYData,z=[],t=k.length,q=this.options,r=q.threshold,h=y(q.startFromThreshold&&r,0),f=q.stack;q=q.stacking;var a=this.stackKey,l="-"+a,e=this.negStacks,c=this.yAxis,m=c.stacking.stacks,u=c.stacking.oldStacks,L,F;c.stacking.stacksTouched+=1;for(F= 0;F<t;F++){var w=g[F];var p=k[F];var C=this.getStackIndicator(C,w,this.index);var O=C.key;var B=(L=e&&p<(h?0:r))?l:a;m[B]||(m[B]={});m[B][w]||(u[B]&&u[B][w]?(m[B][w]=u[B][w],m[B][w].total=null):m[B][w]=new J(c,c.options.stackLabels,L,w,f));B=m[B][w];null!==p?(B.points[O]=B.points[this.index]=[y(B.cumulative,h)],G(B.cumulative)||(B.base=O),B.touched=c.stacking.stacksTouched,0<C.index&&!1===this.singleStacks&&(B.points[O][0]=B.points[this.index+","+w+",0"][0])):B.points[O]=B.points[this.index]=null; "percent"===q?(L=L?a:l,e&&m[L]&&m[L][w]?(L=m[L][w],B.total=L.total=Math.max(L.total,B.total)+Math.abs(p)||0):B.total=K(B.total+(Math.abs(p)||0))):B.total=K(B.total+(p||0));B.cumulative=y(B.cumulative,h)+(p||0);null!==p&&(B.points[O].push(B.cumulative),z[F]=B.cumulative)}"percent"===q&&(c.stacking.usePercentage=!0);this.stackedYData=z;c.stacking.oldStacks={}}};I.prototype.modifyStacks=function(){var g=this,k=g.stackKey,z=g.yAxis.stacking.stacks,t=g.processedXData,q,r=g.options.stacking;g[r+"Stacker"]&& [k,"-"+k].forEach(function(h){for(var f=t.length,a,l;f--;)if(a=t[f],q=g.getStackIndicator(q,a,g.index,h),l=(a=z[h]&&z[h][a])&&a.points[q.key])g[r+"Stacker"](l,a,f)})};I.prototype.percentStacker=function(g,k,z){k=k.total?100/k.total:0;g[0]=K(g[0]*k);g[1]=K(g[1]*k);this.stackedYData[z]=g[1]};I.prototype.getStackIndicator=function(g,k,z,t){!G(g)||g.x!==k||t&&g.key!==t?g={x:k,index:0,key:t}:g.index++;g.key=[z,k,g.index].join();return g};g.StackItem=J;return g.StackItem});P(A,"parts/Dynamics.js",[A["parts/Globals.js"], A["parts/Point.js"],A["parts/Time.js"],A["parts/Utilities.js"]],function(k,g,H,v){var K=v.addEvent,G=v.animate,N=v.createElement,M=v.css,y=v.defined,I=v.erase,J=v.error,E=v.extend,D=v.fireEvent,z=v.isArray,t=v.isNumber,q=v.isObject,r=v.isString,h=v.merge,f=v.objectEach,a=v.pick,l=v.relativeLength,e=v.setAnimation,c=v.splat,m=k.Axis;v=k.Chart;var u=k.Series,L=k.seriesTypes;k.cleanRecursively=function(a,c){var e={};f(a,function(f,h){if(q(a[h],!0)&&!a.nodeType&&c[h])f=k.cleanRecursively(a[h],c[h]),Object.keys(f).length&& (e[h]=f);else if(q(a[h])||a[h]!==c[h])e[h]=a[h]});return e};E(v.prototype,{addSeries:function(c,e,f){var h,p=this;c&&(e=a(e,!0),D(p,"addSeries",{options:c},function(){h=p.initSeries(c);p.isDirtyLegend=!0;p.linkSeries();h.enabledDataSorting&&h.setData(c.data,!1);D(p,"afterAddSeries",{series:h});e&&p.redraw(f)}));return h},addAxis:function(a,c,e,f){return this.createAxis(c?"xAxis":"yAxis",{axis:a,redraw:e,animation:f})},addColorAxis:function(a,c,e){return this.createAxis("colorAxis",{axis:a,redraw:c, animation:e})},createAxis:function(e,f){var p=this.options,l="colorAxis"===e,u=f.redraw,w=f.animation;f=h(f.axis,{index:this[e].length,isX:"xAxis"===e});var d=l?new k.ColorAxis(this,f):new m(this,f);p[e]=c(p[e]||{});p[e].push(f);l&&(this.isDirtyLegend=!0,this.axes.forEach(function(b){b.series=[]}),this.series.forEach(function(b){b.bindAxes();b.isDirtyData=!0}));a(u,!0)&&this.redraw(w);return d},showLoading:function(c){var e=this,f=e.options,h=e.loadingDiv,l=f.loading,m=function(){h&&M(h,{left:e.plotLeft+ "px",top:e.plotTop+"px",width:e.plotWidth+"px",height:e.plotHeight+"px"})};h||(e.loadingDiv=h=N("div",{className:"highcharts-loading highcharts-loading-hidden"},null,e.container),e.loadingSpan=N("span",{className:"highcharts-loading-inner"},null,h),K(e,"redraw",m));h.className="highcharts-loading";e.loadingSpan.innerHTML=a(c,f.lang.loading,"");e.styledMode||(M(h,E(l.style,{zIndex:10})),M(e.loadingSpan,l.labelStyle),e.loadingShown||(M(h,{opacity:0,display:""}),G(h,{opacity:l.style.opacity||.5},{duration:l.showDuration|| 0})));e.loadingShown=!0;m()},hideLoading:function(){var a=this.options,c=this.loadingDiv;c&&(c.className="highcharts-loading highcharts-loading-hidden",this.styledMode||G(c,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){M(c,{display:"none"})}}));this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "), propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" "),collectionsWithUpdate:["xAxis","yAxis","zAxis","series"],update:function(e,m,p,u){var w=this,g={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"},d,b,n,C=e.isResponsiveOptions,q=[];D(w,"update",{options:e});C||w.setResponsive(!1,!0);e=k.cleanRecursively(e,w.options);h(!0,w.userOptions,e);if(d=e.chart){h(!0,w.options.chart,d);"className"in d&&w.setClassName(d.className);"reflow"in d&&w.setReflow(d.reflow);if("inverted"in d||"polar"in d||"type"in d){w.propFromSeries();var F=!0}"alignTicks"in d&&(F=!0);f(d,function(a,d){-1!==w.propsRequireUpdateSeries.indexOf("chart."+d)&&(b=!0);-1!==w.propsRequireDirtyBox.indexOf(d)&&(w.isDirtyBox=!0);C||-1===w.propsRequireReflow.indexOf(d)||(n=!0)});!w.styledMode&&"style"in d&&w.renderer.setStyle(d.style)}!w.styledMode&&e.colors&&(this.options.colors=e.colors);e.plotOptions&&h(!0,this.options.plotOptions, e.plotOptions);e.time&&this.time===k.time&&(this.time=new H(e.time));f(e,function(a,d){if(w[d]&&"function"===typeof w[d].update)w[d].update(a,!1);else if("function"===typeof w[g[d]])w[g[d]](a);"chart"!==d&&-1!==w.propsRequireUpdateSeries.indexOf(d)&&(b=!0)});this.collectionsWithUpdate.forEach(function(b){if(e[b]){if("series"===b){var d=[];w[b].forEach(function(b,c){b.options.isInternal||d.push(a(b.options.index,c))})}c(e[b]).forEach(function(a,c){(c=y(a.id)&&w.get(a.id)||w[b][d?d[c]:c])&&c.coll=== b&&(c.update(a,!1),p&&(c.touched=!0));!c&&p&&w.collectionsWithInit[b]&&(w.collectionsWithInit[b][0].apply(w,[a].concat(w.collectionsWithInit[b][1]||[]).concat([!1])).touched=!0)});p&&w[b].forEach(function(b){b.touched||b.options.isInternal?delete b.touched:q.push(b)})}});q.forEach(function(b){b.remove&&b.remove(!1)});F&&w.axes.forEach(function(b){b.update({},!1)});b&&w.getSeriesOrderByLinks().forEach(function(b){b.chart&&b.update({},!1)},this);e.loading&&h(!0,w.options.loading,e.loading);F=d&&d.width; d=d&&d.height;r(d)&&(d=l(d,F||w.chartWidth));n||t(F)&&F!==w.chartWidth||t(d)&&d!==w.chartHeight?w.setSize(F,d,u):a(m,!0)&&w.redraw(u);D(w,"afterUpdate",{options:e,redraw:m,animation:u})},setSubtitle:function(a,c){this.applyDescription("subtitle",a);this.layOutTitles(c)},setCaption:function(a,c){this.applyDescription("caption",a);this.layOutTitles(c)}});v.prototype.collectionsWithInit={xAxis:[v.prototype.addAxis,[!0]],yAxis:[v.prototype.addAxis,[!1]],series:[v.prototype.addSeries]};E(g.prototype,{update:function(c, e,f,h){function p(){l.applyOptions(c);var h=b&&l.hasDummyGraphic;h=null===l.y?!h:h;b&&h&&(l.graphic=b.destroy(),delete l.hasDummyGraphic);q(c,!0)&&(b&&b.element&&c&&c.marker&&"undefined"!==typeof c.marker.symbol&&(l.graphic=b.destroy()),c&&c.dataLabels&&l.dataLabel&&(l.dataLabel=l.dataLabel.destroy()),l.connector&&(l.connector=l.connector.destroy()));n=l.index;d.updateParallelArrays(l,n);u.data[n]=q(u.data[n],!0)||q(c,!0)?l.options:a(c,u.data[n]);d.isDirty=d.isDirtyData=!0;!d.fixedBox&&d.hasCartesianSeries&& (m.isDirtyBox=!0);"point"===u.legendType&&(m.isDirtyLegend=!0);e&&m.redraw(f)}var l=this,d=l.series,b=l.graphic,n,m=d.chart,u=d.options;e=a(e,!0);!1===h?p():l.firePointEvent("update",{options:c},p)},remove:function(a,c){this.series.removePoint(this.series.data.indexOf(this),a,c)}});E(u.prototype,{addPoint:function(c,e,f,h,l){var p=this.options,d=this.data,b=this.chart,n=this.xAxis;n=n&&n.hasNames&&n.names;var m=p.data,u=this.xData,w;e=a(e,!0);var g={series:this};this.pointClass.prototype.applyOptions.apply(g, [c]);var C=g.x;var r=u.length;if(this.requireSorting&&C<u[r-1])for(w=!0;r&&u[r-1]>C;)r--;this.updateParallelArrays(g,"splice",r,0,0);this.updateParallelArrays(g,r);n&&g.name&&(n[C]=g.name);m.splice(r,0,c);w&&(this.data.splice(r,0,null),this.processData());"point"===p.legendType&&this.generatePoints();f&&(d[0]&&d[0].remove?d[0].remove(!1):(d.shift(),this.updateParallelArrays(g,"shift"),m.shift()));!1!==l&&D(this,"addPoint",{point:g});this.isDirtyData=this.isDirty=!0;e&&b.redraw(h)},removePoint:function(c, f,h){var p=this,l=p.data,m=l[c],d=p.points,b=p.chart,n=function(){d&&d.length===l.length&&d.splice(c,1);l.splice(c,1);p.options.data.splice(c,1);p.updateParallelArrays(m||{series:p},"splice",c,1);m&&m.destroy();p.isDirty=!0;p.isDirtyData=!0;f&&b.redraw()};e(h,b);f=a(f,!0);m?m.firePointEvent("remove",null,n):n()},remove:function(c,e,f,h){function p(){l.destroy(h);l.remove=null;d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries();a(c,!0)&&d.redraw(e)}var l=this,d=l.chart;!1!==f?D(l,"remove",null,p):p()}, update:function(c,e){c=k.cleanRecursively(c,this.userOptions);D(this,"update",{options:c});var f=this,l=f.chart,m=f.userOptions,u=f.initialType||f.type,d=c.type||m.type||l.options.chart.type,b=!(this.hasDerivedData||c.dataGrouping||d&&d!==this.type||"undefined"!==typeof c.pointStart||c.pointInterval||c.pointIntervalUnit||c.keys),n=L[u].prototype,w,g=["group","markerGroup","dataLabelsGroup","transformGroup"],r=["eventOptions","navigatorSeries","baseSeries"],q=f.finishedAnimating&&{animation:!1},t= {};b&&(r.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","_hasPointMarkers","_hasPointLabels","mapMap","mapData","minY","maxY","minX","maxX"),!1!==c.visible&&r.push("area","graph"),f.parallelArrays.forEach(function(b){r.push(b+"Data")}),c.data&&(c.dataSorting&&E(f.options.dataSorting,c.dataSorting),this.setData(c.data,!1)));c=h(m,q,{index:"undefined"===typeof m.index?f.index:m.index,pointStart:a(m.pointStart,f.xData[0])},!b&&{data:f.options.data},c);b&&c.data&&(c.data= f.options.data);r=g.concat(r);r.forEach(function(b){r[b]=f[b];delete f[b]});f.remove(!1,null,!1,!0);for(w in n)f[w]=void 0;L[d||u]?E(f,L[d||u].prototype):J(17,!0,l,{missingModuleFor:d||u});r.forEach(function(b){f[b]=r[b]});f.init(l,c);if(b&&this.points){var F=f.options;!1===F.visible?(t.graphic=1,t.dataLabel=1):f._hasPointLabels||(d=F.marker,n=F.dataLabels,d&&(!1===d.enabled||"symbol"in d)&&(t.graphic=1),n&&!1===n.enabled&&(t.dataLabel=1));this.points.forEach(function(b){b&&b.series&&(b.resolveColor(), Object.keys(t).length&&b.destroyElements(t),!1===F.showInLegend&&b.legendItem&&l.legend.destroyItem(b))},this)}c.zIndex!==m.zIndex&&g.forEach(function(b){f[b]&&f[b].attr({zIndex:c.zIndex})});f.initialType=u;l.linkSeries();D(this,"afterUpdate");a(e,!0)&&l.redraw(b?void 0:!1)},setName:function(a){this.name=this.options.name=this.userOptions.name=a;this.chart.isDirtyLegend=!0}});E(m.prototype,{update:function(c,e){var p=this.chart,l=c&&c.events||{};c=h(this.userOptions,c);p.options[this.coll].indexOf&& (p.options[this.coll][p.options[this.coll].indexOf(this.userOptions)]=c);f(p.options[this.coll].events,function(a,c){"undefined"===typeof l[c]&&(l[c]=void 0)});this.destroy(!0);this.init(p,E(c,{events:l}));p.isDirtyBox=!0;a(e,!0)&&p.redraw()},remove:function(c){for(var e=this.chart,f=this.coll,h=this.series,l=h.length;l--;)h[l]&&h[l].remove(!1);I(e.axes,this);I(e[f],this);z(e.options[f])?e.options[f].splice(this.options.index,1):delete e.options[f];e[f].forEach(function(a,d){a.options.index=a.userOptions.index= d});this.destroy();e.isDirtyBox=!0;a(c,!0)&&e.redraw()},setTitle:function(a,c){this.update({title:a},c)},setCategories:function(a,c){this.update({categories:a},c)}})});P(A,"parts/AreaSeries.js",[A["parts/Globals.js"],A["parts/Color.js"],A["mixins/legend-symbol.js"],A["parts/Utilities.js"]],function(k,g,H,v){var K=g.parse,G=v.objectEach,N=v.pick;g=v.seriesType;var M=k.Series;g("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(g){var k=[],y=[],v=this.xAxis,D=this.yAxis, z=D.stacking.stacks[this.stackKey],t={},q=this.index,r=D.series,h=r.length,f=N(D.options.reversedStacks,!0)?1:-1,a;g=g||this.points;if(this.options.stacking){for(a=0;a<g.length;a++)g[a].leftNull=g[a].rightNull=void 0,t[g[a].x]=g[a];G(z,function(a,c){null!==a.total&&y.push(c)});y.sort(function(a,c){return a-c});var l=r.map(function(a){return a.visible});y.forEach(function(e,c){var m=0,u,g;if(t[e]&&!t[e].isNull)k.push(t[e]),[-1,1].forEach(function(m){var w=1===m?"rightNull":"leftNull",p=0,C=z[y[c+m]]; if(C)for(a=q;0<=a&&a<h;)u=C.points[a],u||(a===q?t[e][w]=!0:l[a]&&(g=z[e].points[a])&&(p-=g[1]-g[0])),a+=f;t[e][1===m?"rightCliff":"leftCliff"]=p});else{for(a=q;0<=a&&a<h;){if(u=z[e].points[a]){m=u[1];break}a+=f}m=D.translate(m,0,1,0,1);k.push({isNull:!0,plotX:v.translate(e,0,0,0,1),x:e,plotY:m,yBottom:m})}})}return k},getGraphPath:function(g){var k=M.prototype.getGraphPath,y=this.options,v=y.stacking,D=this.yAxis,z,t=[],q=[],r=this.index,h=D.stacking.stacks[this.stackKey],f=y.threshold,a=Math.round(D.getThreshold(y.threshold)); y=N(y.connectNulls,"percent"===v);var l=function(e,l,m){var u=g[e];e=v&&h[u.x].points[r];var p=u[m+"Null"]||0;m=u[m+"Cliff"]||0;u=!0;if(m||p){var C=(p?e[0]:e[1])+m;var k=e[0]+m;u=!!p}else!v&&g[l]&&g[l].isNull&&(C=k=f);"undefined"!==typeof C&&(q.push({plotX:c,plotY:null===C?a:D.getThreshold(C),isNull:u,isCliff:!0}),t.push({plotX:c,plotY:null===k?a:D.getThreshold(k),doCurve:!1}))};g=g||this.points;v&&(g=this.getStackPoints(g));for(z=0;z<g.length;z++){v||(g[z].leftCliff=g[z].rightCliff=g[z].leftNull= g[z].rightNull=void 0);var e=g[z].isNull;var c=N(g[z].rectPlotX,g[z].plotX);var m=N(g[z].yBottom,a);if(!e||y)y||l(z,z-1,"left"),e&&!v&&y||(q.push(g[z]),t.push({x:z,plotX:c,plotY:m})),y||l(z,z+1,"right")}z=k.call(this,q,!0,!0);t.reversed=!0;e=k.call(this,t,!0,!0);(m=e[0])&&"M"===m[0]&&(e[0]=["L",m[1],m[2]]);e=z.concat(e);k=k.call(this,q,!1,y);e.xMap=z.xMap;this.areaPath=e;return k},drawGraph:function(){this.areaPath=[];M.prototype.drawGraph.apply(this);var g=this,k=this.areaPath,v=this.options,E=[["area", "highcharts-area",this.color,v.fillColor]];this.zones.forEach(function(k,z){E.push(["zone-area-"+z,"highcharts-area highcharts-zone-area-"+z+" "+k.className,k.color||g.color,k.fillColor||v.fillColor])});E.forEach(function(y){var z=y[0],t=g[z],q=t?"animate":"attr",r={};t?(t.endX=g.preventGraphAnimation?null:k.xMap,t.animate({d:k})):(r.zIndex=0,t=g[z]=g.chart.renderer.path(k).addClass(y[1]).add(g.group),t.isArea=!0);g.chart.styledMode||(r.fill=N(y[3],K(y[2]).setOpacity(N(v.fillOpacity,.75)).get())); t[q](r);t.startX=k.xMap;t.shiftUnit=v.step?2:1})},drawLegendSymbol:H.drawRectangle});""});P(A,"parts/SplineSeries.js",[A["parts/Utilities.js"]],function(k){var g=k.pick;k=k.seriesType;k("spline","line",{},{getPointSpline:function(k,v,K){var G=v.plotX||0,N=v.plotY||0,M=k[K-1];K=k[K+1];if(M&&!M.isNull&&!1!==M.doCurve&&!v.isCliff&&K&&!K.isNull&&!1!==K.doCurve&&!v.isCliff){k=M.plotY||0;var y=K.plotX||0;K=K.plotY||0;var I=0;var J=(1.5*G+(M.plotX||0))/2.5;var E=(1.5*N+k)/2.5;y=(1.5*G+y)/2.5;var D=(1.5* N+K)/2.5;y!==J&&(I=(D-E)*(y-G)/(y-J)+N-D);E+=I;D+=I;E>k&&E>N?(E=Math.max(k,N),D=2*N-E):E<k&&E<N&&(E=Math.min(k,N),D=2*N-E);D>K&&D>N?(D=Math.max(K,N),E=2*N-D):D<K&&D<N&&(D=Math.min(K,N),E=2*N-D);v.rightContX=y;v.rightContY=D}v=["C",g(M.rightContX,M.plotX,0),g(M.rightContY,M.plotY,0),g(J,G,0),g(E,N,0),G,N];M.rightContX=M.rightContY=void 0;return v}});""});P(A,"parts/AreaSplineSeries.js",[A["parts/Globals.js"],A["mixins/legend-symbol.js"],A["parts/Utilities.js"]],function(k,g,H){H=H.seriesType;var v= k.seriesTypes.area.prototype;H("areaspline","spline",k.defaultPlotOptions.area,{getStackPoints:v.getStackPoints,getGraphPath:v.getGraphPath,drawGraph:v.drawGraph,drawLegendSymbol:g.drawRectangle});""});P(A,"parts/ColumnSeries.js",[A["parts/Globals.js"],A["parts/Color.js"],A["mixins/legend-symbol.js"],A["parts/Utilities.js"]],function(k,g,H,v){"";var K=g.parse,G=v.animObject,N=v.clamp,M=v.defined,y=v.extend,I=v.isNumber,J=v.merge,E=v.pick;g=v.seriesType;var D=k.Series;g("column","line",{borderRadius:0, groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1},select:{color:"#cccccc",borderColor:"#000000"}},dataLabels:{align:null,verticalAlign:null,y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:"#ffffff"},{cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){D.prototype.init.apply(this,arguments);var g=this,k=g.chart; k.hasRendered&&k.series.forEach(function(k){k.type===g.type&&(k.isDirty=!0)})},getColumnMetrics:function(){var g=this,k=g.options,q=g.xAxis,r=g.yAxis,h=q.options.reversedStacks;h=q.reversed&&!h||!q.reversed&&h;var f,a={},l=0;!1===k.grouping?l=1:g.chart.series.forEach(function(c){var e=c.yAxis,h=c.options;if(c.type===g.type&&(c.visible||!g.chart.options.chart.ignoreHiddenSeries)&&r.len===e.len&&r.pos===e.pos){if(h.stacking){f=c.stackKey;"undefined"===typeof a[f]&&(a[f]=l++);var m=a[f]}else!1!==h.grouping&& (m=l++);c.columnIndex=m}});var e=Math.min(Math.abs(q.transA)*(q.ordinal&&q.ordinal.slope||k.pointRange||q.closestPointRange||q.tickInterval||1),q.len),c=e*k.groupPadding,m=(e-2*c)/(l||1);k=Math.min(k.maxPointWidth||q.len,E(k.pointWidth,m*(1-2*k.pointPadding)));g.columnMetrics={width:k,offset:(m-k)/2+(c+((g.columnIndex||0)+(h?1:0))*m-e/2)*(h?-1:1)};return g.columnMetrics},crispCol:function(g,k,q,r){var h=this.chart,f=this.borderWidth,a=-(f%2?.5:0);f=f%2?.5:1;h.inverted&&h.renderer.isVML&&(f+=1);this.options.crisp&& (q=Math.round(g+q)+a,g=Math.round(g)+a,q-=g);r=Math.round(k+r)+f;a=.5>=Math.abs(k)&&.5<r;k=Math.round(k)+f;r-=k;a&&r&&(--k,r+=1);return{x:g,y:k,width:q,height:r}},translate:function(){var g=this,k=g.chart,q=g.options,r=g.dense=2>g.closestPointRange*g.xAxis.transA;r=g.borderWidth=E(q.borderWidth,r?0:1);var h=g.xAxis,f=g.yAxis,a=q.threshold,l=g.translatedThreshold=f.getThreshold(a),e=E(q.minPointLength,5),c=g.getColumnMetrics(),m=c.width,u=g.barW=Math.max(m,1+2*r),L=g.pointXOffset=c.offset,F=g.dataMin, w=g.dataMax;k.inverted&&(l-=.5);q.pointPadding&&(u=Math.ceil(u));D.prototype.translate.apply(g);g.points.forEach(function(c){var p=E(c.yBottom,l),r=999+Math.abs(p),q=m,d=c.plotX;r=N(c.plotY,-r,f.len+r);var b=c.plotX+L,n=u,x=Math.min(r,p),t=Math.max(r,p)-x;if(e&&Math.abs(t)<e){t=e;var z=!f.reversed&&!c.negative||f.reversed&&c.negative;I(a)&&I(w)&&c.y===a&&w<=a&&(f.min||0)<a&&F!==w&&(z=!z);x=Math.abs(x-l)>e?p-e:l-(z?e:0)}M(c.options.pointWidth)&&(q=n=Math.ceil(c.options.pointWidth),b-=Math.round((q- m)/2));c.barX=b;c.pointWidth=q;c.tooltipPos=k.inverted?[f.len+f.pos-k.plotLeft-r,h.len+h.pos-k.plotTop-(d||0)-L-n/2,t]:[b+n/2,r+f.pos-k.plotTop,t];c.shapeType=g.pointClass.prototype.shapeType||"rect";c.shapeArgs=g.crispCol.apply(g,c.isNull?[b,l,n,0]:[b,x,n,t])})},getSymbol:k.noop,drawLegendSymbol:H.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(g,k){var q=this.options,r=this.pointAttrToOptions||{};var h=r.stroke|| "borderColor";var f=r["stroke-width"]||"borderWidth",a=g&&g.color||this.color,l=g&&g[h]||q[h]||this.color||a,e=g&&g[f]||q[f]||this[f]||0;r=g&&g.options.dashStyle||q.dashStyle;var c=E(g&&g.opacity,q.opacity,1);if(g&&this.zones.length){var m=g.getZone();a=g.options.color||m&&(m.color||g.nonZonedColor)||this.color;m&&(l=m.borderColor||l,r=m.dashStyle||r,e=m.borderWidth||e)}k&&g&&(g=J(q.states[k],g.options.states&&g.options.states[k]||{}),k=g.brightness,a=g.color||"undefined"!==typeof k&&K(a).brighten(g.brightness).get()|| a,l=g[h]||l,e=g[f]||e,r=g.dashStyle||r,c=E(g.opacity,c));h={fill:a,stroke:l,"stroke-width":e,opacity:c};r&&(h.dashstyle=r);return h},drawPoints:function(){var g=this,k=this.chart,q=g.options,r=k.renderer,h=q.animationLimit||250,f;g.points.forEach(function(a){var l=a.graphic,e=!!l,c=l&&k.pointCount<h?"animate":"attr";if(I(a.plotY)&&null!==a.y){f=a.shapeArgs;l&&a.hasNewShapeType()&&(l=l.destroy());g.enabledDataSorting&&(a.startXPos=g.xAxis.reversed?-(f?f.width:0):g.xAxis.width);l||(a.graphic=l=r[a.shapeType](f).add(a.group|| g.group))&&g.enabledDataSorting&&k.hasRendered&&k.pointCount<h&&(l.attr({x:a.startXPos}),e=!0,c="animate");if(l&&e)l[c](J(f));if(q.borderRadius)l[c]({r:q.borderRadius});k.styledMode||l[c](g.pointAttribs(a,a.selected&&"select")).shadow(!1!==a.allowShadow&&q.shadow,null,q.stacking&&!q.borderRadius);l.addClass(a.getClassName(),!0)}else l&&(a.graphic=l.destroy())})},animate:function(g){var k=this,q=this.yAxis,r=k.options,h=this.chart.inverted,f={},a=h?"translateX":"translateY";if(g)f.scaleY=.001,g=N(q.toPixels(r.threshold), q.pos,q.pos+q.len),h?f.translateX=g-q.len:f.translateY=g,k.clipBox&&k.setClip(),k.group.attr(f);else{var l=k.group.attr(a);k.group.animate({scaleY:1},y(G(k.options.animation),{step:function(e,c){k.group&&(f[a]=l+c.pos*(q.pos-l),k.group.attr(f))}}))}},remove:function(){var g=this,k=g.chart;k.hasRendered&&k.series.forEach(function(k){k.type===g.type&&(k.isDirty=!0)});D.prototype.remove.apply(g,arguments)}});""});P(A,"parts/BarSeries.js",[A["parts/Utilities.js"]],function(k){k=k.seriesType;k("bar","column", null,{inverted:!0});""});P(A,"parts/ScatterSeries.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.addEvent;g=g.seriesType;var v=k.Series;g("scatter","line",{lineWidth:0,findNearestPointBy:"xy",jitter:{x:0,y:0},marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">\u25cf</span> <span style="font-size: 10px"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group", "markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,drawGraph:function(){this.options.lineWidth&&v.prototype.drawGraph.call(this)},applyJitter:function(){var g=this,k=this.options.jitter,v=this.points.length;k&&this.points.forEach(function(G,y){["x","y"].forEach(function(I,J){var E="plot"+I.toUpperCase();if(k[I]&&!G.isNull){var D=g[I+"Axis"];var z=k[I]*D.transA;if(D&&!D.isLog){var t=Math.max(0,G[E]-z);D=Math.min(D.len,G[E]+z);J=1E4*Math.sin(y+J*v);G[E]=t+(D-t)*(J-Math.floor(J));"x"===I&&(G.clientX= G.plotX)}}})})}});H(v,"afterTranslate",function(){this.applyJitter&&this.applyJitter()});""});P(A,"mixins/centered-series.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.isNumber,v=g.pick,K=g.relativeLength,G=k.deg2rad;k.CenteredSeriesMixin={getCenter:function(){var g=this.options,k=this.chart,y=2*(g.slicedOffset||0),G=k.plotWidth-2*y,J=k.plotHeight-2*y,E=g.center,D=Math.min(G,J),z=g.size,t=g.innerSize||0;"string"===typeof z&&(z=parseFloat(z));"string"===typeof t&&(t=parseFloat(t)); g=[v(E[0],"50%"),v(E[1],"50%"),v(z&&0>z?void 0:g.size,"100%"),v(t&&0>t?void 0:g.innerSize||0,"0%")];k.angular&&(g[3]=0);for(E=0;4>E;++E)z=g[E],k=2>E||2===E&&/%$/.test(z),g[E]=K(z,[G,J,D,g[2]][E])+(k?y:0);g[3]>g[2]&&(g[3]=g[2]);return g},getStartAndEndRadians:function(g,k){g=H(g)?g:0;k=H(k)&&k>g&&360>k-g?k:g+360;return{start:G*(g+-90),end:G*(k+-90)}}}});P(A,"parts/PieSeries.js",[A["parts/Globals.js"],A["mixins/legend-symbol.js"],A["parts/Point.js"],A["parts/Utilities.js"]],function(k,g,H,v){var K= v.addEvent,G=v.clamp,A=v.defined,M=v.fireEvent,y=v.isNumber,I=v.merge,J=v.pick,E=v.relativeLength,D=v.seriesType,z=v.setAnimation;v=k.CenteredSeriesMixin;var t=v.getStartAndEndRadians,q=k.noop,r=k.Series;D("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0,connectorPadding:5,connectorShape:"fixedOffset",crookDistance:"70%",distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0, inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:k.seriesTypes.column.prototype.pointAttribs,animate:function(h){var f=this,a=f.points,l=f.startAngleRad;h||a.forEach(function(a){var c=a.graphic, e=a.shapeArgs;c&&e&&(c.attr({r:J(a.startR,f.center&&f.center[3]/2),start:l,end:l}),c.animate({r:e.r,start:e.start,end:e.end},f.options.animation))})},hasData:function(){return!!this.processedXData.length},updateTotals:function(){var h,f=0,a=this.points,l=a.length,e=this.options.ignoreHiddenPoint;for(h=0;h<l;h++){var c=a[h];f+=e&&!c.visible?0:c.isNull?0:c.y}this.total=f;for(h=0;h<l;h++)c=a[h],c.percentage=0<f&&(c.visible||!e)?c.y/f*100:0,c.total=f},generatePoints:function(){r.prototype.generatePoints.call(this); this.updateTotals()},getX:function(h,f,a){var l=this.center,e=this.radii?this.radii[a.index]:l[2]/2;h=Math.asin(G((h-l[1])/(e+a.labelDistance),-1,1));return l[0]+(f?-1:1)*Math.cos(h)*(e+a.labelDistance)+(0<a.labelDistance?(f?-1:1)*this.options.dataLabels.padding:0)},translate:function(h){this.generatePoints();var f=0,a=this.options,l=a.slicedOffset,e=l+(a.borderWidth||0),c=t(a.startAngle,a.endAngle),g=this.startAngleRad=c.start;c=(this.endAngleRad=c.end)-g;var u=this.points,k=a.dataLabels.distance; a=a.ignoreHiddenPoint;var r,w=u.length;h||(this.center=h=this.getCenter());for(r=0;r<w;r++){var p=u[r];var C=g+f*c;if(!a||p.visible)f+=p.percentage/100;var q=g+f*c;p.shapeType="arc";p.shapeArgs={x:h[0],y:h[1],r:h[2]/2,innerR:h[3]/2,start:Math.round(1E3*C)/1E3,end:Math.round(1E3*q)/1E3};p.labelDistance=J(p.options.dataLabels&&p.options.dataLabels.distance,k);p.labelDistance=E(p.labelDistance,p.shapeArgs.r);this.maxLabelDistance=Math.max(this.maxLabelDistance||0,p.labelDistance);q=(q+C)/2;q>1.5*Math.PI? q-=2*Math.PI:q<-Math.PI/2&&(q+=2*Math.PI);p.slicedTranslation={translateX:Math.round(Math.cos(q)*l),translateY:Math.round(Math.sin(q)*l)};var B=Math.cos(q)*h[2]/2;var d=Math.sin(q)*h[2]/2;p.tooltipPos=[h[0]+.7*B,h[1]+.7*d];p.half=q<-Math.PI/2||q>Math.PI/2?1:0;p.angle=q;C=Math.min(e,p.labelDistance/5);p.labelPosition={natural:{x:h[0]+B+Math.cos(q)*p.labelDistance,y:h[1]+d+Math.sin(q)*p.labelDistance},"final":{},alignment:0>p.labelDistance?"center":p.half?"right":"left",connectorPosition:{breakAt:{x:h[0]+ B+Math.cos(q)*C,y:h[1]+d+Math.sin(q)*C},touchingSliceAt:{x:h[0]+B,y:h[1]+d}}}}M(this,"afterTranslate")},drawEmpty:function(){var h=this.options;if(0===this.total){var f=this.center[0];var a=this.center[1];this.graph||(this.graph=this.chart.renderer.circle(f,a,0).addClass("highcharts-graph").add(this.group));this.graph.animate({"stroke-width":h.borderWidth,cx:f,cy:a,r:this.center[2]/2,fill:h.fillColor||"none",stroke:h.color||"#cccccc"},this.options.animation)}else this.graph&&(this.graph=this.graph.destroy())}, redrawPoints:function(){var h=this,f=h.chart,a=f.renderer,l,e,c,g,u=h.options.shadow;this.drawEmpty();!u||h.shadowGroup||f.styledMode||(h.shadowGroup=a.g("shadow").attr({zIndex:-1}).add(h.group));h.points.forEach(function(m){var k={};e=m.graphic;if(!m.isNull&&e){g=m.shapeArgs;l=m.getTranslate();if(!f.styledMode){var w=m.shadowGroup;u&&!w&&(w=m.shadowGroup=a.g("shadow").add(h.shadowGroup));w&&w.attr(l);c=h.pointAttribs(m,m.selected&&"select")}m.delayedRendering?(e.setRadialReference(h.center).attr(g).attr(l), f.styledMode||e.attr(c).attr({"stroke-linejoin":"round"}).shadow(u,w),m.delayedRendering=!1):(e.setRadialReference(h.center),f.styledMode||I(!0,k,c),I(!0,k,g,l),e.animate(k));e.attr({visibility:m.visible?"inherit":"hidden"});e.addClass(m.getClassName())}else e&&(m.graphic=e.destroy())})},drawPoints:function(){var h=this.chart.renderer;this.points.forEach(function(f){f.graphic&&f.hasNewShapeType()&&(f.graphic=f.graphic.destroy());f.graphic||(f.graphic=h[f.shapeType](f.shapeArgs).add(f.series.group), f.delayedRendering=!0)})},searchPoint:q,sortByAngle:function(h,f){h.sort(function(a,h){return"undefined"!==typeof a.angle&&(h.angle-a.angle)*f})},drawLegendSymbol:g.drawRectangle,getCenter:v.getCenter,getSymbol:q,drawGraph:null},{init:function(){H.prototype.init.apply(this,arguments);var h=this;h.name=J(h.name,"Slice");var f=function(a){h.slice("select"===a.type)};K(h,"select",f);K(h,"unselect",f);return h},isValid:function(){return y(this.y)&&0<=this.y},setVisible:function(h,f){var a=this,l=a.series, e=l.chart,c=l.options.ignoreHiddenPoint;f=J(f,c);h!==a.visible&&(a.visible=a.options.visible=h="undefined"===typeof h?!a.visible:h,l.options.data[l.data.indexOf(a)]=a.options,["graphic","dataLabel","connector","shadowGroup"].forEach(function(c){if(a[c])a[c][h?"show":"hide"](!0)}),a.legendItem&&e.legend.colorizeItem(a,h),h||"hover"!==a.state||a.setState(""),c&&(l.isDirty=!0),f&&e.redraw())},slice:function(h,f,a){var l=this.series;z(a,l.chart);J(f,!0);this.sliced=this.options.sliced=A(h)?h:!this.sliced; l.options.data[l.data.indexOf(this)]=this.options;this.graphic&&this.graphic.animate(this.getTranslate());this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},getTranslate:function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},haloPath:function(h){var f=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(f.x,f.y,f.r+h,f.r+h,{innerR:f.r-1,start:f.start,end:f.end})},connectorShapes:{fixedOffset:function(h,f,a){var l=f.breakAt; f=f.touchingSliceAt;return[["M",h.x,h.y],a.softConnector?["C",h.x+("left"===h.alignment?-5:5),h.y,2*l.x-f.x,2*l.y-f.y,l.x,l.y]:["L",l.x,l.y],["L",f.x,f.y]]},straight:function(h,f){f=f.touchingSliceAt;return[["M",h.x,h.y],["L",f.x,f.y]]},crookedLine:function(h,f,a){f=f.touchingSliceAt;var l=this.series,e=l.center[0],c=l.chart.plotWidth,g=l.chart.plotLeft;l=h.alignment;var u=this.shapeArgs.r;a=E(a.crookDistance,1);c="left"===l?e+u+(c+g-e-u)*(1-a):g+(e-u)*a;a=["L",c,h.y];e=!0;if("left"===l?c>h.x||c< f.x:c<h.x||c>f.x)e=!1;h=[["M",h.x,h.y]];e&&h.push(a);h.push(["L",f.x,f.y]);return h}},getConnectorPath:function(){var h=this.labelPosition,f=this.series.options.dataLabels,a=f.connectorShape,l=this.connectorShapes;l[a]&&(a=l[a]);return a.call(this,{x:h.final.x,y:h.final.y,alignment:h.alignment},h.connectorPosition,f)}});""});P(A,"parts/DataLabels.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.animObject,v=g.arrayMax,A=g.clamp,G=g.defined,N=g.extend,M=g.fireEvent,y=g.format, I=g.isArray,J=g.merge,E=g.objectEach,D=g.pick,z=g.relativeLength,t=g.splat,q=g.stableSort;g=k.noop;var r=k.Series,h=k.seriesTypes;k.distribute=function(f,a,h){function e(a,c){return a.target-c.target}var c,l=!0,g=f,r=[];var t=0;var w=g.reducedLen||a;for(c=f.length;c--;)t+=f[c].size;if(t>w){q(f,function(a,c){return(c.rank||0)-(a.rank||0)});for(t=c=0;t<=w;)t+=f[c].size,c++;r=f.splice(c-1,f.length)}q(f,e);for(f=f.map(function(a){return{size:a.size,targets:[a.target],align:D(a.align,.5)}});l;){for(c= f.length;c--;)l=f[c],t=(Math.min.apply(0,l.targets)+Math.max.apply(0,l.targets))/2,l.pos=A(t-l.size*l.align,0,a-l.size);c=f.length;for(l=!1;c--;)0<c&&f[c-1].pos+f[c-1].size>f[c].pos&&(f[c-1].size+=f[c].size,f[c-1].targets=f[c-1].targets.concat(f[c].targets),f[c-1].align=.5,f[c-1].pos+f[c-1].size>a&&(f[c-1].pos=a-f[c-1].size),f.splice(c,1),l=!0)}g.push.apply(g,r);c=0;f.some(function(e){var f=0;if(e.targets.some(function(){g[c].pos=e.pos+f;if("undefined"!==typeof h&&Math.abs(g[c].pos-g[c].target)>h)return g.slice(0, c+1).forEach(function(a){delete a.pos}),g.reducedLen=(g.reducedLen||a)-.1*a,g.reducedLen>.1*a&&k.distribute(g,a,h),!0;f+=g[c].size;c++}))return!0});q(g,e)};r.prototype.drawDataLabels=function(){function f(a,b){var d=b.filter;return d?(b=d.operator,a=a[d.property],d=d.value,">"===b&&a>d||"<"===b&&a<d||">="===b&&a>=d||"<="===b&&a<=d||"=="===b&&a==d||"==="===b&&a===d?!0:!1):!0}function a(a,b){var d=[],c;if(I(a)&&!I(b))d=a.map(function(a){return J(a,b)});else if(I(b)&&!I(a))d=b.map(function(b){return J(a, b)});else if(I(a)||I(b))for(c=Math.max(a.length,b.length);c--;)d[c]=J(a[c],b[c]);else d=J(a,b);return d}var h=this,e=h.chart,c=h.options,g=c.dataLabels,u=h.points,k,r=h.hasRendered||0,w=H(c.animation).duration,p=Math.min(w,200),C=!e.renderer.forExport&&D(g.defer,0<p),q=e.renderer;g=a(a(e.options.plotOptions&&e.options.plotOptions.series&&e.options.plotOptions.series.dataLabels,e.options.plotOptions&&e.options.plotOptions[h.type]&&e.options.plotOptions[h.type].dataLabels),g);M(this,"drawDataLabels"); if(I(g)||g.enabled||h._hasPointLabels){var B=h.plotGroup("dataLabelsGroup","data-labels",C&&!r?"hidden":"inherit",g.zIndex||6);C&&(B.attr({opacity:+r}),r||setTimeout(function(){var a=h.dataLabelsGroup;a&&(h.visible&&B.show(!0),a[c.animation?"animate":"attr"]({opacity:1},{duration:p}))},w-p));u.forEach(function(d){k=t(a(g,d.dlOptions||d.options&&d.options.dataLabels));k.forEach(function(b,a){var p=b.enabled&&(!d.isNull||d.dataLabelOnNull)&&f(d,b),g=d.dataLabels?d.dataLabels[a]:d.dataLabel,l=d.connectors? d.connectors[a]:d.connector,m=D(b.distance,d.labelDistance),n=!g;if(p){var u=d.getLabelConfig();var w=D(b[d.formatPrefix+"Format"],b.format);u=G(w)?y(w,u,e):(b[d.formatPrefix+"Formatter"]||b.formatter).call(u,b);w=b.style;var k=b.rotation;e.styledMode||(w.color=D(b.color,w.color,h.color,"#000000"),"contrast"===w.color?(d.contrastColor=q.getContrast(d.color||h.color),w.color=!G(m)&&b.inside||0>m||c.stacking?d.contrastColor:"#000000"):delete d.contrastColor,c.cursor&&(w.cursor=c.cursor));var r={r:b.borderRadius|| 0,rotation:k,padding:b.padding,zIndex:1};e.styledMode||(r.fill=b.backgroundColor,r.stroke=b.borderColor,r["stroke-width"]=b.borderWidth);E(r,function(b,a){"undefined"===typeof b&&delete r[a]})}!g||p&&G(u)?p&&G(u)&&(g?r.text=u:(d.dataLabels=d.dataLabels||[],g=d.dataLabels[a]=k?q.text(u,0,-9999,b.useHTML).addClass("highcharts-data-label"):q.label(u,0,-9999,b.shape,null,null,b.useHTML,null,"data-label"),a||(d.dataLabel=g),g.addClass(" highcharts-data-label-color-"+d.colorIndex+" "+(b.className||"")+ (b.useHTML?" highcharts-tracker":""))),g.options=b,g.attr(r),e.styledMode||g.css(w).shadow(b.shadow),g.added||g.add(B),b.textPath&&!b.useHTML&&(g.setTextPath(d.getDataLabelPath&&d.getDataLabelPath(g)||d.graphic,b.textPath),d.dataLabelPath&&!b.textPath.enabled&&(d.dataLabelPath=d.dataLabelPath.destroy())),h.alignDataLabel(d,g,b,null,n)):(d.dataLabel=d.dataLabel&&d.dataLabel.destroy(),d.dataLabels&&(1===d.dataLabels.length?delete d.dataLabels:delete d.dataLabels[a]),a||delete d.dataLabel,l&&(d.connector= d.connector.destroy(),d.connectors&&(1===d.connectors.length?delete d.connectors:delete d.connectors[a])))})})}M(this,"afterDrawDataLabels")};r.prototype.alignDataLabel=function(f,a,h,e,c){var g=this,l=this.chart,k=this.isCartesian&&l.inverted,r=this.enabledDataSorting,w=D(f.dlBox&&f.dlBox.centerX,f.plotX,-9999),p=D(f.plotY,-9999),C=a.getBBox(),q=h.rotation,t=h.align,d=l.isInsidePlot(w,Math.round(p),k),b="justify"===D(h.overflow,r?"none":"justify"),n=this.visible&&!1!==f.visible&&(f.series.forceDL|| r&&!b||d||h.inside&&e&&l.isInsidePlot(w,k?e.x+1:e.y+e.height-1,k));var x=function(e){r&&g.xAxis&&!b&&g.setDataLabelStartPos(f,a,c,d,e)};if(n){var v=l.renderer.fontMetrics(l.styledMode?void 0:h.style.fontSize,a).b;e=N({x:k?this.yAxis.len-p:w,y:Math.round(k?this.xAxis.len-w:p),width:0,height:0},e);N(h,{width:C.width,height:C.height});q?(b=!1,w=l.renderer.rotCorr(v,q),w={x:e.x+h.x+e.width/2+w.x,y:e.y+h.y+{top:0,middle:.5,bottom:1}[h.verticalAlign]*e.height},x(w),a[c?"attr":"animate"](w).attr({align:t}), x=(q+720)%360,x=180<x&&360>x,"left"===t?w.y-=x?C.height:0:"center"===t?(w.x-=C.width/2,w.y-=C.height/2):"right"===t&&(w.x-=C.width,w.y-=x?0:C.height),a.placed=!0,a.alignAttr=w):(x(e),a.align(h,null,e),w=a.alignAttr);b&&0<=e.height?this.justifyDataLabel(a,h,w,C,e,c):D(h.crop,!0)&&(n=l.isInsidePlot(w.x,w.y)&&l.isInsidePlot(w.x+C.width,w.y+C.height));if(h.shape&&!q)a[c?"attr":"animate"]({anchorX:k?l.plotWidth-f.plotY:f.plotX,anchorY:k?l.plotHeight-f.plotX:f.plotY})}c&&r&&(a.placed=!1);n||r&&!b||(a.hide(!0), a.placed=!1)};r.prototype.setDataLabelStartPos=function(f,a,h,e,c){var g=this.chart,l=g.inverted,k=this.xAxis,r=k.reversed,w=l?a.height/2:a.width/2;f=(f=f.pointWidth)?f/2:0;k=l?c.x:r?-w-f:k.width-w+f;c=l?r?this.yAxis.height-w+f:-w-f:c.y;a.startXPos=k;a.startYPos=c;e?"hidden"===a.visibility&&(a.show(),a.attr({opacity:0}).animate({opacity:1})):a.attr({opacity:1}).animate({opacity:0},void 0,a.hide);g.hasRendered&&(h&&a.attr({x:a.startXPos,y:a.startYPos}),a.placed=!0)};r.prototype.justifyDataLabel=function(f, a,h,e,c,g){var l=this.chart,m=a.align,k=a.verticalAlign,w=f.box?0:f.padding||0;var p=h.x+w;if(0>p){"right"===m?(a.align="left",a.inside=!0):a.x=-p;var r=!0}p=h.x+e.width-w;p>l.plotWidth&&("left"===m?(a.align="right",a.inside=!0):a.x=l.plotWidth-p,r=!0);p=h.y+w;0>p&&("bottom"===k?(a.verticalAlign="top",a.inside=!0):a.y=-p,r=!0);p=h.y+e.height-w;p>l.plotHeight&&("top"===k?(a.verticalAlign="bottom",a.inside=!0):a.y=l.plotHeight-p,r=!0);r&&(f.placed=!g,f.align(a,null,c));return r};h.pie&&(h.pie.prototype.dataLabelPositioners= {radialDistributionY:function(f){return f.top+f.distributeBox.pos},radialDistributionX:function(f,a,h,e){return f.getX(h<a.top+2||h>a.bottom-2?e:h,a.half,a)},justify:function(f,a,h){return h[0]+(f.half?-1:1)*(a+f.labelDistance)},alignToPlotEdges:function(f,a,h,e){f=f.getBBox().width;return a?f+e:h-f-e},alignToConnectors:function(f,a,h,e){var c=0,g;f.forEach(function(a){g=a.dataLabel.getBBox().width;g>c&&(c=g)});return a?c+e:h-c-e}},h.pie.prototype.drawDataLabels=function(){var f=this,a=f.data,h,e= f.chart,c=f.options.dataLabels||{},g=c.connectorPadding,u,q=e.plotWidth,t=e.plotHeight,w=e.plotLeft,p=Math.round(e.chartWidth/3),C,y=f.center,B=y[2]/2,d=y[1],b,n,x,z,E=[[],[]],I,H,A,M,K=[0,0,0,0],N=f.dataLabelPositioners,P;f.visible&&(c.enabled||f._hasPointLabels)&&(a.forEach(function(b){b.dataLabel&&b.visible&&b.dataLabel.shortened&&(b.dataLabel.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),b.dataLabel.shortened=!1)}),r.prototype.drawDataLabels.apply(f),a.forEach(function(b){b.dataLabel&& (b.visible?(E[b.half].push(b),b.dataLabel._pos=null,!G(c.style.width)&&!G(b.options.dataLabels&&b.options.dataLabels.style&&b.options.dataLabels.style.width)&&b.dataLabel.getBBox().width>p&&(b.dataLabel.css({width:Math.round(.7*p)+"px"}),b.dataLabel.shortened=!0)):(b.dataLabel=b.dataLabel.destroy(),b.dataLabels&&1===b.dataLabels.length&&delete b.dataLabels))}),E.forEach(function(a,p){var l=a.length,m=[],u;if(l){f.sortByAngle(a,p-.5);if(0<f.maxLabelDistance){var r=Math.max(0,d-B-f.maxLabelDistance); var C=Math.min(d+B+f.maxLabelDistance,e.plotHeight);a.forEach(function(b){0<b.labelDistance&&b.dataLabel&&(b.top=Math.max(0,d-B-b.labelDistance),b.bottom=Math.min(d+B+b.labelDistance,e.plotHeight),u=b.dataLabel.getBBox().height||21,b.distributeBox={target:b.labelPosition.natural.y-b.top+u/2,size:u,rank:b.y},m.push(b.distributeBox))});r=C+u-r;k.distribute(m,r,r/5)}for(M=0;M<l;M++){h=a[M];x=h.labelPosition;b=h.dataLabel;A=!1===h.visible?"hidden":"inherit";H=r=x.natural.y;m&&G(h.distributeBox)&&("undefined"=== typeof h.distributeBox.pos?A="hidden":(z=h.distributeBox.size,H=N.radialDistributionY(h)));delete h.positionIndex;if(c.justify)I=N.justify(h,B,y);else switch(c.alignTo){case "connectors":I=N.alignToConnectors(a,p,q,w);break;case "plotEdges":I=N.alignToPlotEdges(b,p,q,w);break;default:I=N.radialDistributionX(f,h,H,r)}b._attr={visibility:A,align:x.alignment};P=h.options.dataLabels||{};b._pos={x:I+D(P.x,c.x)+({left:g,right:-g}[x.alignment]||0),y:H+D(P.y,c.y)-10};x.final.x=I;x.final.y=H;D(c.crop,!0)&& (n=b.getBBox().width,r=null,I-n<g&&1===p?(r=Math.round(n-I+g),K[3]=Math.max(r,K[3])):I+n>q-g&&0===p&&(r=Math.round(I+n-q+g),K[1]=Math.max(r,K[1])),0>H-z/2?K[0]=Math.max(Math.round(-H+z/2),K[0]):H+z/2>t&&(K[2]=Math.max(Math.round(H+z/2-t),K[2])),b.sideOverflow=r)}}}),0===v(K)||this.verifyDataLabelOverflow(K))&&(this.placeDataLabels(),this.points.forEach(function(a){P=J(c,a.options.dataLabels);if(u=D(P.connectorWidth,1)){var d;C=a.connector;if((b=a.dataLabel)&&b._pos&&a.visible&&0<a.labelDistance){A= b._attr.visibility;if(d=!C)a.connector=C=e.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex+(a.className?" "+a.className:"")).add(f.dataLabelsGroup),e.styledMode||C.attr({"stroke-width":u,stroke:P.connectorColor||a.color||"#666666"});C[d?"attr":"animate"]({d:a.getConnectorPath()});C.attr("visibility",A)}else C&&(a.connector=C.destroy())}}))},h.pie.prototype.placeDataLabels=function(){this.points.forEach(function(f){var a=f.dataLabel,h;a&&f.visible&&((h=a._pos)? (a.sideOverflow&&(a._attr.width=Math.max(a.getBBox().width-a.sideOverflow,0),a.css({width:a._attr.width+"px",textOverflow:(this.options.dataLabels.style||{}).textOverflow||"ellipsis"}),a.shortened=!0),a.attr(a._attr),a[a.moved?"animate":"attr"](h),a.moved=!0):a&&a.attr({y:-9999}));delete f.distributeBox},this)},h.pie.prototype.alignDataLabel=g,h.pie.prototype.verifyDataLabelOverflow=function(f){var a=this.center,h=this.options,e=h.center,c=h.minSize||80,g=null!==h.size;if(!g){if(null!==e[0])var u= Math.max(a[2]-Math.max(f[1],f[3]),c);else u=Math.max(a[2]-f[1]-f[3],c),a[0]+=(f[3]-f[1])/2;null!==e[1]?u=A(u,c,a[2]-Math.max(f[0],f[2])):(u=A(u,c,a[2]-f[0]-f[2]),a[1]+=(f[0]-f[2])/2);u<a[2]?(a[2]=u,a[3]=Math.min(z(h.innerSize||0,u),u),this.translate(a),this.drawDataLabels&&this.drawDataLabels()):g=!0}return g});h.column&&(h.column.prototype.alignDataLabel=function(f,a,h,e,c){var g=this.chart.inverted,l=f.series,k=f.dlBox||f.shapeArgs,q=D(f.below,f.plotY>D(this.translatedThreshold,l.yAxis.len)),w= D(h.inside,!!this.options.stacking);k&&(e=J(k),0>e.y&&(e.height+=e.y,e.y=0),k=e.y+e.height-l.yAxis.len,0<k&&k<e.height&&(e.height-=k),g&&(e={x:l.yAxis.len-e.y-e.height,y:l.xAxis.len-e.x-e.width,width:e.height,height:e.width}),w||(g?(e.x+=q?0:e.width,e.width=0):(e.y+=q?e.height:0,e.height=0)));h.align=D(h.align,!g||w?"center":q?"right":"left");h.verticalAlign=D(h.verticalAlign,g||w?"middle":q?"top":"bottom");r.prototype.alignDataLabel.call(this,f,a,h,e,c);h.inside&&f.contrastColor&&a.css({color:f.contrastColor})})}); P(A,"modules/overlapping-datalabels.src.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var H=g.addEvent,v=g.fireEvent,A=g.isArray,G=g.objectEach,N=g.pick;k=k.Chart;H(k,"render",function(){var g=[];(this.labelCollectors||[]).forEach(function(k){g=g.concat(k())});(this.yAxis||[]).forEach(function(k){k.stacking&&k.options.stackLabels&&!k.options.stackLabels.allowOverlap&&G(k.stacking.stacks,function(k){G(k,function(k){g.push(k.label)})})});(this.series||[]).forEach(function(k){var v= k.options.dataLabels;k.visible&&(!1!==v.enabled||k._hasPointLabels)&&(k.nodes||k.points).forEach(function(k){k.visible&&(A(k.dataLabels)?k.dataLabels:k.dataLabel?[k.dataLabel]:[]).forEach(function(v){var y=v.options;v.labelrank=N(y.labelrank,k.labelrank,k.shapeArgs&&k.shapeArgs.height);y.allowOverlap||g.push(v)})})});this.hideOverlappingLabels(g)});k.prototype.hideOverlappingLabels=function(g){var k=this,G=g.length,J=k.renderer,E,D,z,t=!1;var q=function(f){var a,h=f.box?0:f.padding||0,e=a=0,c;if(f&& (!f.alignAttr||f.placed)){var g=f.alignAttr||{x:f.attr("x"),y:f.attr("y")};var u=f.parentGroup;f.width||(a=f.getBBox(),f.width=a.width,f.height=a.height,a=J.fontMetrics(null,f.element).h);var k=f.width-2*h;(c={left:"0",center:"0.5",right:"1"}[f.alignValue])?e=+c*k:Math.round(f.x)!==f.translateX&&(e=f.x-f.translateX);return{x:g.x+(u.translateX||0)+h-e,y:g.y+(u.translateY||0)+h-a,width:f.width-2*h,height:f.height-2*h}}};for(D=0;D<G;D++)if(E=g[D])E.oldOpacity=E.opacity,E.newOpacity=1,E.absoluteBox=q(E); g.sort(function(f,a){return(a.labelrank||0)-(f.labelrank||0)});for(D=0;D<G;D++){var r=(q=g[D])&&q.absoluteBox;for(E=D+1;E<G;++E){var h=(z=g[E])&&z.absoluteBox;!r||!h||q===z||0===q.newOpacity||0===z.newOpacity||h.x>r.x+r.width||h.x+h.width<r.x||h.y>r.y+r.height||h.y+h.height<r.y||((q.labelrank<z.labelrank?q:z).newOpacity=0)}}g.forEach(function(f){if(f){var a=f.newOpacity;f.oldOpacity!==a&&(f.alignAttr&&f.placed?(f[a?"removeClass":"addClass"]("highcharts-data-label-hidden"),t=!0,f.alignAttr.opacity= a,f[f.isOld?"animate":"attr"](f.alignAttr,null,function(){k.styledMode||f.css({pointerEvents:a?"auto":"none"});f.visibility=a?"inherit":"hidden";f.placed=!!a}),v(k,"afterHideOverlappingLabel")):f.attr({opacity:a}));f.isOld=!0}});t&&v(k,"afterHideAllOverlappingLabels")}});P(A,"parts/Interaction.js",[A["parts/Globals.js"],A["parts/Legend.js"],A["parts/Point.js"],A["parts/Utilities.js"]],function(k,g,H,v){var A=v.addEvent,G=v.createElement,N=v.css,M=v.defined,y=v.extend,I=v.fireEvent,J=v.isArray,E=v.isFunction, D=v.isNumber,z=v.isObject,t=v.merge,q=v.objectEach,r=v.pick;v=k.Chart;var h=k.defaultOptions,f=k.defaultPlotOptions,a=k.hasTouch,l=k.Series,e=k.seriesTypes,c=k.svg;var m=k.TrackerMixin={drawTrackerPoint:function(){var c=this,e=c.chart,f=e.pointer,h=function(a){var c=f.getPointFromEvent(a);"undefined"!==typeof c&&(f.isDirectTouch=!0,c.onMouseOver(a))},g;c.points.forEach(function(a){g=J(a.dataLabels)?a.dataLabels:a.dataLabel?[a.dataLabel]:[];a.graphic&&(a.graphic.element.point=a);g.forEach(function(c){c.div? c.div.point=a:c.element.point=a})});c._hasTracking||(c.trackerGroups.forEach(function(g){if(c[g]){c[g].addClass("highcharts-tracker").on("mouseover",h).on("mouseout",function(a){f.onTrackerMouseOut(a)});if(a)c[g].on("touchstart",h);!e.styledMode&&c.options.cursor&&c[g].css(N).css({cursor:c.options.cursor})}}),c._hasTracking=!0);I(this,"afterDrawTracker")},drawTrackerGraph:function(){var e=this,f=e.options,h=f.trackByArea,g=[].concat(h?e.areaPath:e.graphPath),p=e.chart,l=p.pointer,m=p.renderer,k=p.options.tooltip.snap, d=e.tracker,b=function(b){if(p.hoverSeries!==e)e.onMouseOver()},n="rgba(192,192,192,"+(c?.0001:.002)+")";d?d.attr({d:g}):e.graph&&(e.tracker=m.path(g).attr({visibility:e.visible?"visible":"hidden",zIndex:2}).addClass(h?"highcharts-tracker-area":"highcharts-tracker-line").add(e.group),p.styledMode||e.tracker.attr({"stroke-linecap":"round","stroke-linejoin":"round",stroke:n,fill:h?n:"none","stroke-width":e.graph.strokeWidth()+(h?0:2*k)}),[e.tracker,e.markerGroup].forEach(function(d){d.addClass("highcharts-tracker").on("mouseover", b).on("mouseout",function(b){l.onTrackerMouseOut(b)});f.cursor&&!p.styledMode&&d.css({cursor:f.cursor});if(a)d.on("touchstart",b)}));I(this,"afterDrawTracker")}};e.column&&(e.column.prototype.drawTracker=m.drawTrackerPoint);e.pie&&(e.pie.prototype.drawTracker=m.drawTrackerPoint);e.scatter&&(e.scatter.prototype.drawTracker=m.drawTrackerPoint);y(g.prototype,{setItemEvents:function(a,c,e){var f=this,h=f.chart.renderer.boxWrapper,g=a instanceof H,l="highcharts-legend-"+(g?"point":"series")+"-active", m=f.chart.styledMode;(e?[c,a.legendSymbol]:[a.legendGroup]).forEach(function(d){if(d)d.on("mouseover",function(){a.visible&&f.allItems.forEach(function(b){a!==b&&b.setState("inactive",!g)});a.setState("hover");a.visible&&h.addClass(l);m||c.css(f.options.itemHoverStyle)}).on("mouseout",function(){f.chart.styledMode||c.css(t(a.visible?f.itemStyle:f.itemHiddenStyle));f.allItems.forEach(function(b){a!==b&&b.setState("",!g)});h.removeClass(l);a.setState()}).on("click",function(b){var d=function(){a.setVisible&& a.setVisible();f.allItems.forEach(function(b){a!==b&&b.setState(a.visible?"inactive":"",!g)})};h.removeClass(l);b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,d):I(a,"legendItemClick",b,d)})})},createCheckboxForItem:function(a){a.checkbox=G("input",{type:"checkbox",className:"highcharts-legend-checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);A(a.checkbox,"click",function(c){I(a.series||a,"checkboxClick",{checked:c.target.checked, item:a},function(){a.select()})})}});y(v.prototype,{showResetZoom:function(){function a(){c.zoomOut()}var c=this,e=h.lang,f=c.options.chart.resetZoomButton,g=f.theme,l=g.states,m="chart"===f.relativeTo||"spaceBox"===f.relativeTo?null:"plotBox";I(this,"beforeShowResetZoom",null,function(){c.resetZoomButton=c.renderer.button(e.resetZoom,null,null,a,g,l&&l.hover).attr({align:f.position.align,title:e.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(f.position,!1,m)});I(this,"afterShowResetZoom")}, zoomOut:function(){I(this,"selection",{resetSelection:!0},this.zoom)},zoom:function(a){var c=this,e,f=c.pointer,h=!1,g=c.inverted?f.mouseDownX:f.mouseDownY;!a||a.resetSelection?(c.axes.forEach(function(a){e=a.zoom()}),f.initiated=!1):a.xAxis.concat(a.yAxis).forEach(function(a){var d=a.axis,b=c.inverted?d.left:d.top,p=c.inverted?b+d.width:b+d.height,l=d.isXAxis,m=!1;if(!l&&g>=b&&g<=p||l||!M(g))m=!0;f[l?"zoomX":"zoomY"]&&m&&(e=d.zoom(a.min,a.max),d.displayBtn&&(h=!0))});var l=c.resetZoomButton;h&&!l? c.showResetZoom():!h&&z(l)&&(c.resetZoomButton=l.destroy());e&&c.redraw(r(c.options.chart.animation,a&&a.animation,100>c.pointCount))},pan:function(a,c){var e=this,f=e.hoverPoints,h=e.options.chart,g=e.options.mapNavigation&&e.options.mapNavigation.enabled,l;c="object"===typeof c?c:{enabled:c,type:"x"};h&&h.panning&&(h.panning=c);var m=c.type;I(this,"pan",{originalEvent:a},function(){f&&f.forEach(function(b){b.setState()});var d=[1];"xy"===m?d=[1,0]:"y"===m&&(d=[0]);d.forEach(function(b){var d=e[b? "xAxis":"yAxis"][0],c=d.options,f=d.horiz,h=a[f?"chartX":"chartY"];f=f?"mouseDownX":"mouseDownY";var p=e[f],u=(d.pointRange||0)/2,w=d.reversed&&!e.inverted||!d.reversed&&e.inverted?-1:1,r=d.getExtremes(),C=d.toValue(p-h,!0)+u*w;w=d.toValue(p+d.len-h,!0)-u*w;var q=w<C;p=q?w:C;C=q?C:w;var t=d.hasVerticalPanning(),B=d.panningState;d.series.forEach(function(a){if(t&&!b&&(!B||B.isDirty)){var d=a.getProcessedData(!0);a=a.getExtremes(d.yData,!0);B||(B={startMin:Number.MAX_VALUE,startMax:-Number.MAX_VALUE}); D(a.dataMin)&&D(a.dataMax)&&(B.startMin=Math.min(a.dataMin,B.startMin),B.startMax=Math.max(a.dataMax,B.startMax))}});w=Math.min(k.pick(null===B||void 0===B?void 0:B.startMin,r.dataMin),u?r.min:d.toValue(d.toPixels(r.min)-d.minPixelPadding));u=Math.max(k.pick(null===B||void 0===B?void 0:B.startMax,r.dataMax),u?r.max:d.toValue(d.toPixels(r.max)+d.minPixelPadding));d.panningState=B;if(!c.ordinal){c=w-p;0<c&&(C+=c,p=w);c=C-u;0<c&&(C=u,p-=c);if(d.series.length&&p!==r.min&&C!==r.max&&b||B&&p>=w&&C<=u)d.setExtremes(p, C,!1,!1,{trigger:"pan"}),e.resetZoomButton||g||!m.match("y")||(e.showResetZoom(),d.displayBtn=!1),l=!0;e[f]=h}});l&&e.redraw(!1);N(e.container,{cursor:"move"})})}});y(H.prototype,{select:function(a,c){var e=this,f=e.series,h=f.chart;this.selectedStaging=a=r(a,!e.selected);e.firePointEvent(a?"select":"unselect",{accumulate:c},function(){e.selected=e.options.selected=a;f.options.data[f.data.indexOf(e)]=e.options;e.setState(a&&"select");c||h.getSelectedPoints().forEach(function(a){var c=a.series;a.selected&& a!==e&&(a.selected=a.options.selected=!1,c.options.data[c.data.indexOf(a)]=a.options,a.setState(h.hoverPoints&&c.options.inactiveOtherPoints?"inactive":""),a.firePointEvent("unselect"))})});delete this.selectedStaging},onMouseOver:function(a){var c=this.series.chart,e=c.pointer;a=a?e.normalize(a):e.getChartCoordinatesFromPoint(this,c.inverted);e.runPointActions(a,this)},onMouseOut:function(){var a=this.series.chart;this.firePointEvent("mouseOut");this.series.options.inactiveOtherPoints||(a.hoverPoints|| []).forEach(function(a){a.setState()});a.hoverPoints=a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var a=this,c=t(a.series.options.point,a.options).events;a.events=c;q(c,function(c,e){E(c)&&A(a,e,c)});this.hasImportedEvents=!0}},setState:function(a,c){var e=this.series,h=this.state,g=e.options.states[a||"normal"]||{},l=f[e.type].marker&&e.options.marker,m=l&&!1===l.enabled,k=l&&l.states&&l.states[a||"normal"]||{},d=!1===k.enabled,b=e.stateMarkerGraphic,n=this.marker||{},u= e.chart,q=e.halo,t,v=l&&e.markerAttribs;a=a||"";if(!(a===this.state&&!c||this.selected&&"select"!==a||!1===g.enabled||a&&(d||m&&!1===k.enabled)||a&&n.states&&n.states[a]&&!1===n.states[a].enabled)){this.state=a;v&&(t=e.markerAttribs(this,a));if(this.graphic){h&&this.graphic.removeClass("highcharts-point-"+h);a&&this.graphic.addClass("highcharts-point-"+a);if(!u.styledMode){var z=e.pointAttribs(this,a);var D=r(u.options.chart.animation,g.animation);e.options.inactiveOtherPoints&&z.opacity&&((this.dataLabels|| []).forEach(function(a){a&&a.animate({opacity:z.opacity},D)}),this.connector&&this.connector.animate({opacity:z.opacity},D));this.graphic.animate(z,D)}t&&this.graphic.animate(t,r(u.options.chart.animation,k.animation,l.animation));b&&b.hide()}else{if(a&&k){h=n.symbol||e.symbol;b&&b.currentSymbol!==h&&(b=b.destroy());if(t)if(b)b[c?"animate":"attr"]({x:t.x,y:t.y});else h&&(e.stateMarkerGraphic=b=u.renderer.symbol(h,t.x,t.y,t.width,t.height).add(e.markerGroup),b.currentSymbol=h);!u.styledMode&&b&&b.attr(e.pointAttribs(this, a))}b&&(b[a&&this.isInside?"show":"hide"](),b.element.point=this)}a=g.halo;g=(b=this.graphic||b)&&b.visibility||"inherit";a&&a.size&&b&&"hidden"!==g&&!this.isCluster?(q||(e.halo=q=u.renderer.path().add(b.parentGroup)),q.show()[c?"animate":"attr"]({d:this.haloPath(a.size)}),q.attr({"class":"highcharts-halo highcharts-color-"+r(this.colorIndex,e.colorIndex)+(this.className?" "+this.className:""),visibility:g,zIndex:-1}),q.point=this,u.styledMode||q.attr(y({fill:this.color||e.color,"fill-opacity":a.opacity}, a.attributes))):q&&q.point&&q.point.haloPath&&q.animate({d:q.point.haloPath(0)},null,q.hide);I(this,"afterSetState")}},haloPath:function(a){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-a,this.plotY-a,2*a,2*a)}});y(l.prototype,{onMouseOver:function(){var a=this.chart,c=a.hoverSeries;a.pointer.setHoverChartIndex();if(c&&c!==this)c.onMouseOut();this.options.events.mouseOver&&I(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options, c=this.chart,e=c.tooltip,f=c.hoverPoint;c.hoverSeries=null;if(f)f.onMouseOut();this&&a.events.mouseOut&&I(this,"mouseOut");!e||this.stickyTracking||e.shared&&!this.noSharedTooltip||e.hide();c.series.forEach(function(a){a.setState("",!0)})},setState:function(a,c){var e=this,f=e.options,h=e.graph,g=f.inactiveOtherPoints,l=f.states,m=f.lineWidth,d=f.opacity,b=r(l[a||"normal"]&&l[a||"normal"].animation,e.chart.options.chart.animation);f=0;a=a||"";if(e.state!==a&&([e.group,e.markerGroup,e.dataLabelsGroup].forEach(function(b){b&& (e.state&&b.removeClass("highcharts-series-"+e.state),a&&b.addClass("highcharts-series-"+a))}),e.state=a,!e.chart.styledMode)){if(l[a]&&!1===l[a].enabled)return;a&&(m=l[a].lineWidth||m+(l[a].lineWidthPlus||0),d=r(l[a].opacity,d));if(h&&!h.dashstyle)for(l={"stroke-width":m},h.animate(l,b);e["zone-graph-"+f];)e["zone-graph-"+f].attr(l),f+=1;g||[e.group,e.markerGroup,e.dataLabelsGroup,e.labelBySeries].forEach(function(a){a&&a.animate({opacity:d},b)})}c&&g&&e.points&&e.setAllPointsToState(a)},setAllPointsToState:function(a){this.points.forEach(function(c){c.setState&& c.setState(a)})},setVisible:function(a,c){var e=this,f=e.chart,h=e.legendItem,g=f.options.chart.ignoreHiddenSeries,l=e.visible;var m=(e.visible=a=e.options.visible=e.userOptions.visible="undefined"===typeof a?!l:a)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach(function(a){if(e[a])e[a][m]()});if(f.hoverSeries===e||(f.hoverPoint&&f.hoverPoint.series)===e)e.onMouseOut();h&&f.legend.colorizeItem(e,a);e.isDirty=!0;e.options.stacking&&f.series.forEach(function(a){a.options.stacking&& a.visible&&(a.isDirty=!0)});e.linkedSeries.forEach(function(d){d.setVisible(a,!1)});g&&(f.isDirtyBox=!0);I(e,m);!1!==c&&f.redraw()},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=this.options.selected="undefined"===typeof a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);I(this,a?"select":"unselect")},drawTracker:m.drawTrackerGraph})});P(A,"parts/Responsive.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var A= g.find,v=g.isArray,K=g.isObject,G=g.merge,N=g.objectEach,M=g.pick,y=g.splat,I=g.uniqueKey;k=k.Chart;k.prototype.setResponsive=function(g,k){var v=this.options.responsive,z=[],t=this.currentResponsive;!k&&v&&v.rules&&v.rules.forEach(function(g){"undefined"===typeof g._id&&(g._id=I());this.matchResponsiveRule(g,z)},this);k=G.apply(0,z.map(function(g){return A(v.rules,function(k){return k._id===g}).chartOptions}));k.isResponsiveOptions=!0;z=z.toString()||void 0;z!==(t&&t.ruleIds)&&(t&&this.update(t.undoOptions, g,!0),z?(t=this.currentOptions(k),t.isResponsiveOptions=!0,this.currentResponsive={ruleIds:z,mergedOptions:k,undoOptions:t},this.update(k,g,!0)):this.currentResponsive=void 0)};k.prototype.matchResponsiveRule=function(g,k){var v=g.condition;(v.callback||function(){return this.chartWidth<=M(v.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=M(v.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=M(v.minWidth,0)&&this.chartHeight>=M(v.minHeight,0)}).call(this)&&k.push(g._id)};k.prototype.currentOptions=function(g){function k(g, q,r,h){var f;N(g,function(a,g){if(!h&&-1<D.collectionsWithUpdate.indexOf(g))for(a=y(a),r[g]=[],f=0;f<a.length;f++)q[g][f]&&(r[g][f]={},k(a[f],q[g][f],r[g][f],h+1));else K(a)?(r[g]=v(a)?[]:{},k(a,q[g]||{},r[g],h+1)):r[g]="undefined"===typeof q[g]?null:q[g]})}var D=this,z={};k(g,this.options,z,0);return z}});P(A,"masters/highcharts.src.js",[A["parts/Globals.js"]],function(k){return k});P(A,"parts/NavigatorAxis.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var A=k.isTouchDevice,v= g.addEvent,K=g.correctFloat,G=g.defined,N=g.isNumber,M=g.pick,y=function(){function g(g){this.axis=g}g.prototype.destroy=function(){this.axis=void 0};g.prototype.toFixedRange=function(g,k,v,z){var t=this.axis,q=t.chart;q=q&&q.fixedRange;var r=(t.pointRange||0)/2;g=M(v,t.translate(g,!0,!t.horiz));k=M(z,t.translate(k,!0,!t.horiz));t=q&&(k-g)/q;G(v)||(g=K(g+r));G(z)||(k=K(k-r));.7<t&&1.3>t&&(z?g=k-q:k=g+q);N(g)&&N(k)||(g=k=void 0);return{min:g,max:k}};return g}();return function(){function g(){}g.compose= function(g){g.keepProps.push("navigatorAxis");v(g,"init",function(){this.navigatorAxis||(this.navigatorAxis=new y(this))});v(g,"zoom",function(g){var k=this.chart.options,v=k.navigator,t=this.navigatorAxis,q=k.chart.pinchType,r=k.rangeSelector;k=k.chart.zoomType;this.isXAxis&&(v&&v.enabled||r&&r.enabled)&&("y"===k?g.zoomed=!1:(!A&&"xy"===k||A&&"xy"===q)&&this.options.range&&(v=t.previousZoom,G(g.newMin)?t.previousZoom=[this.min,this.max]:v&&(g.newMin=v[0],g.newMax=v[1],t.previousZoom=void 0)));"undefined"!== typeof g.zoomed&&g.preventDefault()})};g.AdditionsClass=y;return g}()});P(A,"parts/ScrollbarAxis.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var A=g.addEvent,v=g.defined,K=g.pick;return function(){function g(){}g.compose=function(g,G){A(g,"afterInit",function(){var g=this;g.options&&g.options.scrollbar&&g.options.scrollbar.enabled&&(g.options.scrollbar.vertical=!g.horiz,g.options.startOnTick=g.options.endOnTick=!1,g.scrollbar=new G(g.chart.renderer,g.options.scrollbar,g.chart), A(g.scrollbar,"changed",function(y){var G=K(g.options&&g.options.min,g.min),E=K(g.options&&g.options.max,g.max),D=v(g.dataMin)?Math.min(G,g.min,g.dataMin):G,z=(v(g.dataMax)?Math.max(E,g.max,g.dataMax):E)-D;v(G)&&v(E)&&(g.horiz&&!g.reversed||!g.horiz&&g.reversed?(G=D+z*this.to,D+=z*this.from):(G=D+z*(1-this.from),D+=z*(1-this.to)),K(this.options.liveRedraw,k.svg&&!k.isTouchDevice&&!this.chart.isBoosting)||"mouseup"===y.DOMType||!v(y.DOMType)?g.setExtremes(D,G,!0,"mousemove"!==y.DOMType,y):this.setRange(this.from, this.to))}))});A(g,"afterRender",function(){var g=Math.min(K(this.options.min,this.min),this.min,K(this.dataMin,this.min)),k=Math.max(K(this.options.max,this.max),this.max,K(this.dataMax,this.max)),G=this.scrollbar,E=this.axisTitleMargin+(this.titleOffset||0),D=this.chart.scrollbarsOffsets,z=this.options.margin||0;G&&(this.horiz?(this.opposite||(D[1]+=E),G.position(this.left,this.top+this.height+2+D[1]-(this.opposite?z:0),this.width,this.height),this.opposite||(D[1]+=z),E=1):(this.opposite&&(D[0]+= E),G.position(this.left+this.width+2+D[0]-(this.opposite?0:z),this.top,this.width,this.height),this.opposite&&(D[0]+=z),E=0),D[E]+=G.size+G.options.margin,isNaN(g)||isNaN(k)||!v(this.min)||!v(this.max)||this.min===this.max?G.setRange(0,1):(D=(this.min-g)/(k-g),g=(this.max-g)/(k-g),this.horiz&&!this.reversed||!this.horiz&&this.reversed?G.setRange(D,g):G.setRange(1-g,1-D)))});A(g,"afterGetOffset",function(){var g=this.horiz?2:1,k=this.scrollbar;k&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[g]+= k.size+k.options.margin)})};return g}()});P(A,"parts/Scrollbar.js",[A["parts/Axis.js"],A["parts/Globals.js"],A["parts/ScrollbarAxis.js"],A["parts/Utilities.js"]],function(k,g,A,v){var H=v.addEvent,G=v.correctFloat,N=v.defined,M=v.destroyObjectProperties,y=v.fireEvent,I=v.merge,J=v.pick,E=v.removeEvent;v=g.defaultOptions;var D=g.hasTouch,z=g.isTouchDevice,t=g.swapXY=function(g,h){h&&g.forEach(function(f){for(var a=f.length,h,e=0;e<a;e+=2)h=f[e+1],"number"===typeof h&&(f[e+1]=f[e+2],f[e+2]=h)});return g}, q=function(){function g(h,f,a){this._events=[];this.from=this.chartY=this.chartX=0;this.scrollbar=this.group=void 0;this.scrollbarButtons=[];this.scrollbarGroup=void 0;this.scrollbarLeft=0;this.scrollbarRifles=void 0;this.scrollbarStrokeWidth=1;this.to=this.size=this.scrollbarTop=0;this.track=void 0;this.trackBorderWidth=1;this.userOptions={};this.y=this.x=0;this.chart=a;this.options=f;this.renderer=a.renderer;this.init(h,f,a)}g.prototype.addEvents=function(){var h=this.options.inverted?[1,0]:[0, 1],f=this.scrollbarButtons,a=this.scrollbarGroup.element,g=this.track.element,e=this.mouseDownHandler.bind(this),c=this.mouseMoveHandler.bind(this),m=this.mouseUpHandler.bind(this);h=[[f[h[0]].element,"click",this.buttonToMinClick.bind(this)],[f[h[1]].element,"click",this.buttonToMaxClick.bind(this)],[g,"click",this.trackClick.bind(this)],[a,"mousedown",e],[a.ownerDocument,"mousemove",c],[a.ownerDocument,"mouseup",m]];D&&h.push([a,"touchstart",e],[a.ownerDocument,"touchmove",c],[a.ownerDocument,"touchend", m]);h.forEach(function(a){H.apply(null,a)});this._events=h};g.prototype.buttonToMaxClick=function(h){var f=(this.to-this.from)*J(this.options.step,.2);this.updatePosition(this.from+f,this.to+f);y(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:h})};g.prototype.buttonToMinClick=function(h){var f=G(this.to-this.from)*J(this.options.step,.2);this.updatePosition(G(this.from-f),G(this.to-f));y(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:h})};g.prototype.cursorToScrollbarPosition= function(h){var f=this.options;f=f.minWidth>this.calculatedWidth?f.minWidth:0;return{chartX:(h.chartX-this.x-this.xOffset)/(this.barWidth-f),chartY:(h.chartY-this.y-this.yOffset)/(this.barWidth-f)}};g.prototype.destroy=function(){var h=this.chart.scroller;this.removeEvents();["track","scrollbarRifles","scrollbar","scrollbarGroup","group"].forEach(function(f){this[f]&&this[f].destroy&&(this[f]=this[f].destroy())},this);h&&this===h.scrollbar&&(h.scrollbar=null,M(h.scrollbarButtons))};g.prototype.drawScrollbarButton= function(h){var f=this.renderer,a=this.scrollbarButtons,g=this.options,e=this.size;var c=f.g().add(this.group);a.push(c);c=f.rect().addClass("highcharts-scrollbar-button").add(c);this.chart.styledMode||c.attr({stroke:g.buttonBorderColor,"stroke-width":g.buttonBorderWidth,fill:g.buttonBackgroundColor});c.attr(c.crisp({x:-.5,y:-.5,width:e+1,height:e+1,r:g.buttonBorderRadius},c.strokeWidth()));c=f.path(t([["M",e/2+(h?-1:1),e/2-3],["L",e/2+(h?-1:1),e/2+3],["L",e/2+(h?2:-2),e/2]],g.vertical)).addClass("highcharts-scrollbar-arrow").add(a[h]); this.chart.styledMode||c.attr({fill:g.buttonArrowColor})};g.prototype.init=function(h,f,a){this.scrollbarButtons=[];this.renderer=h;this.userOptions=f;this.options=I(g.defaultOptions,f);this.chart=a;this.size=J(this.options.size,this.options.height);f.enabled&&(this.render(),this.addEvents())};g.prototype.mouseDownHandler=function(h){h=this.chart.pointer.normalize(h);h=this.cursorToScrollbarPosition(h);this.chartX=h.chartX;this.chartY=h.chartY;this.initPositions=[this.from,this.to];this.grabbedCenter= !0};g.prototype.mouseMoveHandler=function(h){var f=this.chart.pointer.normalize(h),a=this.options.vertical?"chartY":"chartX",g=this.initPositions||[];!this.grabbedCenter||h.touches&&0===h.touches[0][a]||(f=this.cursorToScrollbarPosition(f)[a],a=this[a],a=f-a,this.hasDragged=!0,this.updatePosition(g[0]+a,g[1]+a),this.hasDragged&&y(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMType:h.type,DOMEvent:h}))};g.prototype.mouseUpHandler=function(h){this.hasDragged&&y(this,"changed",{from:this.from, to:this.to,trigger:"scrollbar",DOMType:h.type,DOMEvent:h});this.grabbedCenter=this.hasDragged=this.chartX=this.chartY=null};g.prototype.position=function(h,f,a,g){var e=this.options.vertical,c=0,l=this.rendered?"animate":"attr";this.x=h;this.y=f+this.trackBorderWidth;this.width=a;this.xOffset=this.height=g;this.yOffset=c;e?(this.width=this.yOffset=a=c=this.size,this.xOffset=f=0,this.barWidth=g-2*a,this.x=h+=this.options.margin):(this.height=this.xOffset=g=f=this.size,this.barWidth=a-2*g,this.y+=this.options.margin); this.group[l]({translateX:h,translateY:this.y});this.track[l]({width:a,height:g});this.scrollbarButtons[1][l]({translateX:e?0:a-f,translateY:e?g-c:0})};g.prototype.removeEvents=function(){this._events.forEach(function(h){E.apply(null,h)});this._events.length=0};g.prototype.render=function(){var h=this.renderer,f=this.options,a=this.size,g=this.chart.styledMode,e;this.group=e=h.g("scrollbar").attr({zIndex:f.zIndex,translateY:-99999}).add();this.track=h.rect().addClass("highcharts-scrollbar-track").attr({x:0, r:f.trackBorderRadius||0,height:a,width:a}).add(e);g||this.track.attr({fill:f.trackBackgroundColor,stroke:f.trackBorderColor,"stroke-width":f.trackBorderWidth});this.trackBorderWidth=this.track.strokeWidth();this.track.attr({y:-this.trackBorderWidth%2/2});this.scrollbarGroup=h.g().add(e);this.scrollbar=h.rect().addClass("highcharts-scrollbar-thumb").attr({height:a,width:a,r:f.barBorderRadius||0}).add(this.scrollbarGroup);this.scrollbarRifles=h.path(t([["M",-3,a/4],["L",-3,2*a/3],["M",0,a/4],["L", 0,2*a/3],["M",3,a/4],["L",3,2*a/3]],f.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup);g||(this.scrollbar.attr({fill:f.barBackgroundColor,stroke:f.barBorderColor,"stroke-width":f.barBorderWidth}),this.scrollbarRifles.attr({stroke:f.rifleColor,"stroke-width":1}));this.scrollbarStrokeWidth=this.scrollbar.strokeWidth();this.scrollbarGroup.translate(-this.scrollbarStrokeWidth%2/2,-this.scrollbarStrokeWidth%2/2);this.drawScrollbarButton(0);this.drawScrollbarButton(1)};g.prototype.setRange= function(h,f){var a=this.options,g=a.vertical,e=a.minWidth,c=this.barWidth,m,k=!this.rendered||this.hasDragged||this.chart.navigator&&this.chart.navigator.hasDragged?"attr":"animate";if(N(c)){h=Math.max(h,0);var r=Math.ceil(c*h);this.calculatedWidth=m=G(c*Math.min(f,1)-r);m<e&&(r=(c-e+m)*h,m=e);e=Math.floor(r+this.xOffset+this.yOffset);c=m/2-.5;this.from=h;this.to=f;g?(this.scrollbarGroup[k]({translateY:e}),this.scrollbar[k]({height:m}),this.scrollbarRifles[k]({translateY:c}),this.scrollbarTop=e, this.scrollbarLeft=0):(this.scrollbarGroup[k]({translateX:e}),this.scrollbar[k]({width:m}),this.scrollbarRifles[k]({translateX:c}),this.scrollbarLeft=e,this.scrollbarTop=0);12>=m?this.scrollbarRifles.hide():this.scrollbarRifles.show(!0);!1===a.showFull&&(0>=h&&1<=f?this.group.hide():this.group.show());this.rendered=!0}};g.prototype.trackClick=function(h){var f=this.chart.pointer.normalize(h),a=this.to-this.from,g=this.y+this.scrollbarTop,e=this.x+this.scrollbarLeft;this.options.vertical&&f.chartY> g||!this.options.vertical&&f.chartX>e?this.updatePosition(this.from+a,this.to+a):this.updatePosition(this.from-a,this.to-a);y(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:h})};g.prototype.update=function(h){this.destroy();this.init(this.chart.renderer,I(!0,this.options,h),this.chart)};g.prototype.updatePosition=function(h,f){1<f&&(h=G(1-G(f-h)),f=1);0>h&&(f=G(f-h),h=0);this.from=h;this.to=f};g.defaultOptions={height:z?20:14,barBorderRadius:0,buttonBorderRadius:0,liveRedraw:void 0, margin:10,minWidth:6,step:.2,zIndex:3,barBackgroundColor:"#cccccc",barBorderWidth:1,barBorderColor:"#cccccc",buttonArrowColor:"#333333",buttonBackgroundColor:"#e6e6e6",buttonBorderColor:"#cccccc",buttonBorderWidth:1,rifleColor:"#333333",trackBackgroundColor:"#f2f2f2",trackBorderColor:"#f2f2f2",trackBorderWidth:1};return g}();g.Scrollbar||(v.scrollbar=I(!0,q.defaultOptions,v.scrollbar),g.Scrollbar=q,A.compose(k,q));return g.Scrollbar});P(A,"parts/Navigator.js",[A["parts/Axis.js"],A["parts/Color.js"], A["parts/Globals.js"],A["parts/NavigatorAxis.js"],A["parts/Scrollbar.js"],A["parts/Utilities.js"]],function(k,g,A,v,K,G){g=g.parse;var H=G.addEvent,M=G.clamp,y=G.correctFloat,I=G.defined,J=G.destroyObjectProperties,E=G.erase,D=G.extend,z=G.find,t=G.isArray,q=G.isNumber,r=G.merge,h=G.pick,f=G.removeEvent,a=G.splat;G=A.Chart;var l=A.defaultOptions,e=A.hasTouch,c=A.isTouchDevice,m=A.Series,u=function(a){for(var c=[],e=1;e<arguments.length;e++)c[e-1]=arguments[e];c=[].filter.call(c,q);if(c.length)return Math[a].apply(0, c)};var L="undefined"===typeof A.seriesTypes.areaspline?"line":"areaspline";D(l,{navigator:{height:40,margin:25,maskInside:!0,handles:{width:7,height:15,symbols:["navigator-handle","navigator-handle"],enabled:!0,lineWidth:1,backgroundColor:"#f2f2f2",borderColor:"#999999"},maskFill:g("#6685c2").setOpacity(.3).get(),outlineColor:"#cccccc",outlineWidth:1,series:{type:L,fillOpacity:.05,lineWidth:1,compare:null,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:[["millisecond", [1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2,3,4]],["week",[1,2,3]],["month",[1,3,6]],["year",null]]},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},threshold:null},xAxis:{overscroll:0,className:"highcharts-navigator-xaxis",tickLength:0,lineWidth:0,gridLineColor:"#e6e6e6",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left", style:{color:"#999999"},x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickLength:0,tickWidth:0}}});A.Renderer.prototype.symbols["navigator-handle"]=function(a,c,e,f,h){a=h.width/2;c=Math.round(a/3)+.5;h=h.height||0;return[["M",-a-1,.5],["L",a,.5],["L",a,h+.5],["L",-a-1,h+.5],["L",-a-1,.5],["M",-c,4],["L",-c,h-3],["M",c-1,4],["L",c-1,h-3]]};var F=function(){function g(a){this.zoomedMin= this.zoomedMax=this.yAxis=this.xAxis=this.top=this.size=this.shades=this.rendered=this.range=this.outlineHeight=this.outline=this.opposite=this.navigatorSize=this.navigatorSeries=this.navigatorOptions=this.navigatorGroup=this.navigatorEnabled=this.left=this.height=this.handles=this.chart=this.baseSeries=void 0;this.init(a)}g.prototype.drawHandle=function(a,c,e,f){var d=this.navigatorOptions.handles.height;this.handles[c][f](e?{translateX:Math.round(this.left+this.height/2),translateY:Math.round(this.top+ parseInt(a,10)+.5-d)}:{translateX:Math.round(this.left+parseInt(a,10)),translateY:Math.round(this.top+this.height/2-d/2-1)})};g.prototype.drawOutline=function(a,c,e,f){var d=this.navigatorOptions.maskInside,b=this.outline.strokeWidth(),h=b/2,g=b%2/2;b=this.outlineHeight;var p=this.scrollbarHeight||0,l=this.size,m=this.left-p,k=this.top;e?(m-=h,e=k+c+g,c=k+a+g,g=[["M",m+b,k-p-g],["L",m+b,e],["L",m,e],["L",m,c],["L",m+b,c],["L",m+b,k+l+p]],d&&g.push(["M",m+b,e-h],["L",m+b,c+h])):(a+=m+p-g,c+=m+p-g, k+=h,g=[["M",m,k],["L",a,k],["L",a,k+b],["L",c,k+b],["L",c,k],["L",m+l+2*p,k]],d&&g.push(["M",a-h,k],["L",c+h,k]));this.outline[f]({d:g})};g.prototype.drawMasks=function(a,c,e,f){var d=this.left,b=this.top,h=this.height;if(e){var g=[d,d,d];var p=[b,b+a,b+c];var m=[h,h,h];var l=[a,c-a,this.size-c]}else g=[d,d+a,d+c],p=[b,b,b],m=[a,c-a,this.size-c],l=[h,h,h];this.shades.forEach(function(a,b){a[f]({x:g[b],y:p[b],width:m[b],height:l[b]})})};g.prototype.renderElements=function(){var a=this,c=a.navigatorOptions, e=c.maskInside,f=a.chart,d=f.renderer,b,h={cursor:f.inverted?"ns-resize":"ew-resize"};a.navigatorGroup=b=d.g("navigator").attr({zIndex:8,visibility:"hidden"}).add();[!e,e,!e].forEach(function(e,g){a.shades[g]=d.rect().addClass("highcharts-navigator-mask"+(1===g?"-inside":"-outside")).add(b);f.styledMode||a.shades[g].attr({fill:e?c.maskFill:"rgba(0,0,0,0)"}).css(1===g&&h)});a.outline=d.path().addClass("highcharts-navigator-outline").add(b);f.styledMode||a.outline.attr({"stroke-width":c.outlineWidth, stroke:c.outlineColor});c.handles.enabled&&[0,1].forEach(function(e){c.handles.inverted=f.inverted;a.handles[e]=d.symbol(c.handles.symbols[e],-c.handles.width/2-1,0,c.handles.width,c.handles.height,c.handles);a.handles[e].attr({zIndex:7-e}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+["left","right"][e]).add(b);if(!f.styledMode){var g=c.handles;a.handles[e].attr({fill:g.backgroundColor,stroke:g.borderColor,"stroke-width":g.lineWidth}).css(h)}})};g.prototype.update=function(a){(this.series|| []).forEach(function(a){a.baseSeries&&delete a.baseSeries.navigatorSeries});this.destroy();r(!0,this.chart.options.navigator,this.options,a);this.init(this.chart)};g.prototype.render=function(a,c,e,f){var d=this.chart,b=this.scrollbarHeight,g,p=this.xAxis,m=p.pointRange||0;var l=p.navigatorAxis.fake?d.xAxis[0]:p;var k=this.navigatorEnabled,r,w=this.rendered;var u=d.inverted;var C=d.xAxis[0].minRange,t=d.xAxis[0].options.maxRange;if(!this.hasDragged||I(e)){a=y(a-m/2);c=y(c+m/2);if(!q(a)||!q(c))if(w)e= 0,f=h(p.width,l.width);else return;this.left=h(p.left,d.plotLeft+b+(u?d.plotWidth:0));this.size=r=g=h(p.len,(u?d.plotHeight:d.plotWidth)-2*b);d=u?b:g+2*b;e=h(e,p.toPixels(a,!0));f=h(f,p.toPixels(c,!0));q(e)&&Infinity!==Math.abs(e)||(e=0,f=d);a=p.toValue(e,!0);c=p.toValue(f,!0);var B=Math.abs(y(c-a));B<C?this.grabbedLeft?e=p.toPixels(c-C-m,!0):this.grabbedRight&&(f=p.toPixels(a+C+m,!0)):I(t)&&y(B-m)>t&&(this.grabbedLeft?e=p.toPixels(c-t-m,!0):this.grabbedRight&&(f=p.toPixels(a+t+m,!0)));this.zoomedMax= M(Math.max(e,f),0,r);this.zoomedMin=M(this.fixedWidth?this.zoomedMax-this.fixedWidth:Math.min(e,f),0,r);this.range=this.zoomedMax-this.zoomedMin;r=Math.round(this.zoomedMax);e=Math.round(this.zoomedMin);k&&(this.navigatorGroup.attr({visibility:"visible"}),w=w&&!this.hasDragged?"animate":"attr",this.drawMasks(e,r,u,w),this.drawOutline(e,r,u,w),this.navigatorOptions.handles.enabled&&(this.drawHandle(e,0,u,w),this.drawHandle(r,1,u,w)));this.scrollbar&&(u?(u=this.top-b,l=this.left-b+(k||!l.opposite?0: (l.titleOffset||0)+l.axisTitleMargin),b=g+2*b):(u=this.top+(k?this.height:-b),l=this.left-b),this.scrollbar.position(l,u,d,b),this.scrollbar.setRange(this.zoomedMin/(g||1),this.zoomedMax/(g||1)));this.rendered=!0}};g.prototype.addMouseEvents=function(){var a=this,c=a.chart,f=c.container,h=[],d,b;a.mouseMoveHandler=d=function(b){a.onMouseMove(b)};a.mouseUpHandler=b=function(b){a.onMouseUp(b)};h=a.getPartsEvents("mousedown");h.push(H(c.renderTo,"mousemove",d),H(f.ownerDocument,"mouseup",b));e&&(h.push(H(c.renderTo, "touchmove",d),H(f.ownerDocument,"touchend",b)),h.concat(a.getPartsEvents("touchstart")));a.eventsToUnbind=h;a.series&&a.series[0]&&h.push(H(a.series[0].xAxis,"foundExtremes",function(){c.navigator.modifyNavigatorAxisExtremes()}))};g.prototype.getPartsEvents=function(a){var c=this,e=[];["shades","handles"].forEach(function(f){c[f].forEach(function(d,b){e.push(H(d.element,a,function(a){c[f+"Mousedown"](a,b)}))})});return e};g.prototype.shadesMousedown=function(a,c){a=this.chart.pointer.normalize(a); var e=this.chart,f=this.xAxis,d=this.zoomedMin,b=this.left,h=this.size,g=this.range,m=a.chartX;e.inverted&&(m=a.chartY,b=this.top);if(1===c)this.grabbedCenter=m,this.fixedWidth=g,this.dragOffset=m-d;else{a=m-b-g/2;if(0===c)a=Math.max(0,a);else if(2===c&&a+g>=h)if(a=h-g,this.reversedExtremes){a-=g;var p=this.getUnionExtremes().dataMin}else var l=this.getUnionExtremes().dataMax;a!==d&&(this.fixedWidth=g,c=f.navigatorAxis.toFixedRange(a,a+g,p,l),I(c.min)&&e.xAxis[0].setExtremes(Math.min(c.min,c.max), Math.max(c.min,c.max),!0,null,{trigger:"navigator"}))}};g.prototype.handlesMousedown=function(a,c){this.chart.pointer.normalize(a);a=this.chart;var e=a.xAxis[0],f=this.reversedExtremes;0===c?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=f?e.min:e.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=f?e.max:e.min);a.fixedRange=null};g.prototype.onMouseMove=function(a){var e=this,f=e.chart,g=e.left,d=e.navigatorSize,b=e.range,m=e.dragOffset,l=f.inverted; a.touches&&0===a.touches[0].pageX||(a=f.pointer.normalize(a),f=a.chartX,l&&(g=e.top,f=a.chartY),e.grabbedLeft?(e.hasDragged=!0,e.render(0,0,f-g,e.otherHandlePos)):e.grabbedRight?(e.hasDragged=!0,e.render(0,0,e.otherHandlePos,f-g)):e.grabbedCenter&&(e.hasDragged=!0,f<m?f=m:f>d+m-b&&(f=d+m-b),e.render(0,0,f-m,f-m+b)),e.hasDragged&&e.scrollbar&&h(e.scrollbar.options.liveRedraw,A.svg&&!c&&!this.chart.isBoosting)&&(a.DOMType=a.type,setTimeout(function(){e.onMouseUp(a)},0)))};g.prototype.onMouseUp=function(a){var c= this.chart,e=this.xAxis,f=this.scrollbar,d=a.DOMEvent||a,b=c.inverted,h=this.rendered&&!this.hasDragged?"animate":"attr",g=Math.round(this.zoomedMax),m=Math.round(this.zoomedMin);if(this.hasDragged&&(!f||!f.hasDragged)||"scrollbar"===a.trigger){f=this.getUnionExtremes();if(this.zoomedMin===this.otherHandlePos)var l=this.fixedExtreme;else if(this.zoomedMax===this.otherHandlePos)var p=this.fixedExtreme;this.zoomedMax===this.size&&(p=this.reversedExtremes?f.dataMin:f.dataMax);0===this.zoomedMin&&(l= this.reversedExtremes?f.dataMax:f.dataMin);e=e.navigatorAxis.toFixedRange(this.zoomedMin,this.zoomedMax,l,p);I(e.min)&&c.xAxis[0].setExtremes(Math.min(e.min,e.max),Math.max(e.min,e.max),!0,this.hasDragged?!1:null,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:d})}"mousemove"!==a.DOMType&&"touchmove"!==a.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null);this.navigatorEnabled&&(this.shades&& this.drawMasks(m,g,b,h),this.outline&&this.drawOutline(m,g,b,h),this.navigatorOptions.handles.enabled&&Object.keys(this.handles).length===this.handles.length&&(this.drawHandle(m,0,b,h),this.drawHandle(g,1,b,h)))};g.prototype.removeEvents=function(){this.eventsToUnbind&&(this.eventsToUnbind.forEach(function(a){a()}),this.eventsToUnbind=void 0);this.removeBaseSeriesEvents()};g.prototype.removeBaseSeriesEvents=function(){var a=this.baseSeries||[];this.navigatorEnabled&&a[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&& a.forEach(function(a){f(a,"updatedData",this.updatedDataHandler)},this),a[0].xAxis&&f(a[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))};g.prototype.init=function(a){var c=a.options,e=c.navigator,f=e.enabled,d=c.scrollbar,b=d.enabled;c=f?e.height:0;var g=b?d.height:0;this.handles=[];this.shades=[];this.chart=a;this.setBaseSeries();this.height=c;this.scrollbarHeight=g;this.scrollbarEnabled=b;this.navigatorEnabled=f;this.navigatorOptions=e;this.scrollbarOptions=d;this.outlineHeight=c+g;this.opposite= h(e.opposite,!(f||!a.inverted));var m=this;f=m.baseSeries;d=a.xAxis.length;b=a.yAxis.length;var l=f&&f[0]&&f[0].xAxis||a.xAxis[0]||{options:{}};a.isDirtyBox=!0;m.navigatorEnabled?(m.xAxis=new k(a,r({breaks:l.options.breaks,ordinal:l.options.ordinal},e.xAxis,{id:"navigator-x-axis",yAxis:"navigator-y-axis",isX:!0,type:"datetime",index:d,isInternal:!0,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1},a.inverted?{offsets:[g,0,-g,0],width:c}:{offsets:[0, -g,0,g],height:c})),m.yAxis=new k(a,r(e.yAxis,{id:"navigator-y-axis",alignTicks:!1,offset:0,index:b,isInternal:!0,zoomEnabled:!1},a.inverted?{width:c}:{height:c})),f||e.series.data?m.updateNavigatorSeries(!1):0===a.series.length&&(m.unbindRedraw=H(a,"beforeRedraw",function(){0<a.series.length&&!m.series&&(m.setBaseSeries(),m.unbindRedraw())})),m.reversedExtremes=a.inverted&&!m.xAxis.reversed||!a.inverted&&m.xAxis.reversed,m.renderElements(),m.addMouseEvents()):(m.xAxis={chart:a,navigatorAxis:{fake:!0}, translate:function(b,d){var c=a.xAxis[0],e=c.getExtremes(),f=c.len-2*g,h=u("min",c.options.min,e.dataMin);c=u("max",c.options.max,e.dataMax)-h;return d?b*c/f+h:f*(b-h)/c},toPixels:function(a){return this.translate(a)},toValue:function(a){return this.translate(a,!0)}},m.xAxis.navigatorAxis.axis=m.xAxis,m.xAxis.navigatorAxis.toFixedRange=v.AdditionsClass.prototype.toFixedRange.bind(m.xAxis.navigatorAxis));a.options.scrollbar.enabled&&(a.scrollbar=m.scrollbar=new K(a.renderer,r(a.options.scrollbar,{margin:m.navigatorEnabled? 0:10,vertical:a.inverted}),a),H(m.scrollbar,"changed",function(b){var d=m.size,c=d*this.to;d*=this.from;m.hasDragged=m.scrollbar.hasDragged;m.render(0,0,d,c);(a.options.scrollbar.liveRedraw||"mousemove"!==b.DOMType&&"touchmove"!==b.DOMType)&&setTimeout(function(){m.onMouseUp(b)})}));m.addBaseSeriesEvents();m.addChartEvents()};g.prototype.getUnionExtremes=function(a){var c=this.chart.xAxis[0],e=this.xAxis,f=e.options,d=c.options,b;a&&null===c.dataMin||(b={dataMin:h(f&&f.min,u("min",d.min,c.dataMin, e.dataMin,e.min)),dataMax:h(f&&f.max,u("max",d.max,c.dataMax,e.dataMax,e.max))});return b};g.prototype.setBaseSeries=function(a,c){var e=this.chart,f=this.baseSeries=[];a=a||e.options&&e.options.navigator.baseSeries||(e.series.length?z(e.series,function(a){return!a.options.isInternal}).index:0);(e.series||[]).forEach(function(d,b){d.options.isInternal||!d.options.showInNavigator&&(b!==a&&d.options.id!==a||!1===d.options.showInNavigator)||f.push(d)});this.xAxis&&!this.xAxis.navigatorAxis.fake&&this.updateNavigatorSeries(!0, c)};g.prototype.updateNavigatorSeries=function(c,e){var g=this,m=g.chart,d=g.baseSeries,b,p,k=g.navigatorOptions.series,u,w={enableMouseTracking:!1,index:null,linkedTo:null,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",showInLegend:!1,stacking:void 0,isInternal:!0,states:{inactive:{opacity:1}}},q=g.series=(g.series||[]).filter(function(a){var b=a.baseSeries;return 0>d.indexOf(b)?(b&&(f(b,"updatedData",g.updatedDataHandler),delete b.navigatorSeries),a.chart&&a.destroy(), !1):!0});d&&d.length&&d.forEach(function(a){var c=a.navigatorSeries,f=D({color:a.color,visible:a.visible},t(k)?l.navigator.series:k);c&&!1===g.navigatorOptions.adaptToUpdatedData||(w.name="Navigator "+d.length,b=a.options||{},u=b.navigatorOptions||{},p=r(b,w,f,u),p.pointRange=h(f.pointRange,u.pointRange,l.plotOptions[p.type||"line"].pointRange),f=u.data||f.data,g.hasNavigatorData=g.hasNavigatorData||!!f,p.data=f||b.data&&b.data.slice(0),c&&c.options?c.update(p,e):(a.navigatorSeries=m.initSeries(p), a.navigatorSeries.baseSeries=a,q.push(a.navigatorSeries)))});if(k.data&&(!d||!d.length)||t(k))g.hasNavigatorData=!1,k=a(k),k.forEach(function(a,b){w.name="Navigator "+(q.length+1);p=r(l.navigator.series,{color:m.series[b]&&!m.series[b].options.isInternal&&m.series[b].color||m.options.colors[b]||m.options.colors[0]},w,a);p.data=a.data;p.data&&(g.hasNavigatorData=!0,q.push(m.initSeries(p)))});c&&this.addBaseSeriesEvents()};g.prototype.addBaseSeriesEvents=function(){var a=this,c=a.baseSeries||[];c[0]&& c[0].xAxis&&H(c[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes);c.forEach(function(c){H(c,"show",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!0,!1)});H(c,"hide",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!1,!1)});!1!==this.navigatorOptions.adaptToUpdatedData&&c.xAxis&&H(c,"updatedData",this.updatedDataHandler);H(c,"remove",function(){this.navigatorSeries&&(E(a.series,this.navigatorSeries),I(this.navigatorSeries.options)&&this.navigatorSeries.remove(!1), delete this.navigatorSeries)})},this)};g.prototype.getBaseSeriesMin=function(a){return this.baseSeries.reduce(function(a,c){return Math.min(a,c.xData?c.xData[0]:a)},a)};g.prototype.modifyNavigatorAxisExtremes=function(){var a=this.xAxis,c;"undefined"!==typeof a.getExtremes&&(!(c=this.getUnionExtremes(!0))||c.dataMin===a.min&&c.dataMax===a.max||(a.min=c.dataMin,a.max=c.dataMax))};g.prototype.modifyBaseAxisExtremes=function(){var a=this.chart.navigator,c=this.getExtremes(),e=c.dataMin,f=c.dataMax;c= c.max-c.min;var d=a.stickToMin,b=a.stickToMax,g=h(this.options.overscroll,0),m=a.series&&a.series[0],l=!!this.setExtremes;if(!this.eventArgs||"rangeSelectorButton"!==this.eventArgs.trigger){if(d){var k=e;var u=k+c}b&&(u=f+g,d||(k=Math.max(e,u-c,a.getBaseSeriesMin(m&&m.xData?m.xData[0]:-Number.MAX_VALUE))));l&&(d||b)&&q(k)&&(this.min=this.userMin=k,this.max=this.userMax=u)}a.stickToMin=a.stickToMax=null};g.prototype.updatedDataHandler=function(){var a=this.chart.navigator,c=this.navigatorSeries,e= a.getBaseSeriesMin(this.xData[0]);a.stickToMax=a.reversedExtremes?0===Math.round(a.zoomedMin):Math.round(a.zoomedMax)>=Math.round(a.size);a.stickToMin=q(this.xAxis.min)&&this.xAxis.min<=e&&(!this.chart.fixedRange||!a.stickToMax);c&&!a.hasNavigatorData&&(c.options.pointStart=this.xData[0],c.setData(this.options.data,!1,null,!1))};g.prototype.addChartEvents=function(){this.eventsToUnbind||(this.eventsToUnbind=[]);this.eventsToUnbind.push(H(this.chart,"redraw",function(){var a=this.navigator,c=a&&(a.baseSeries&& a.baseSeries[0]&&a.baseSeries[0].xAxis||this.xAxis[0]);c&&a.render(c.min,c.max)}),H(this.chart,"getMargins",function(){var a=this.navigator,c=a.opposite?"plotTop":"marginBottom";this.inverted&&(c=a.opposite?"marginRight":"plotLeft");this[c]=(this[c]||0)+(a.navigatorEnabled||!this.inverted?a.outlineHeight:0)+a.navigatorOptions.margin}))};g.prototype.destroy=function(){this.removeEvents();this.xAxis&&(E(this.chart.xAxis,this.xAxis),E(this.chart.axes,this.xAxis));this.yAxis&&(E(this.chart.yAxis,this.yAxis), E(this.chart.axes,this.yAxis));(this.series||[]).forEach(function(a){a.destroy&&a.destroy()});"series xAxis yAxis shades outline scrollbarTrack scrollbarRifles scrollbarGroup scrollbar navigatorGroup rendered".split(" ").forEach(function(a){this[a]&&this[a].destroy&&this[a].destroy();this[a]=null},this);[this.handles].forEach(function(a){J(a)},this)};return g}();A.Navigator||(A.Navigator=F,v.compose(k),H(G,"beforeShowResetZoom",function(){var a=this.options,e=a.navigator,f=a.rangeSelector;if((e&& e.enabled||f&&f.enabled)&&(!c&&"x"===a.chart.zoomType||c&&"x"===a.chart.pinchType))return!1}),H(G,"beforeRender",function(){var a=this.options;if(a.navigator.enabled||a.scrollbar.enabled)this.scroller=this.navigator=new F(this)}),H(G,"afterSetChartSize",function(){var a=this.legend,c=this.navigator;if(c){var e=a&&a.options;var f=c.xAxis;var g=c.yAxis;var d=c.scrollbarHeight;this.inverted?(c.left=c.opposite?this.chartWidth-d-c.height:this.spacing[3]+d,c.top=this.plotTop+d):(c.left=this.plotLeft+d, c.top=c.navigatorOptions.top||this.chartHeight-c.height-d-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?this.rangeSelector.getHeight():0)-(e&&"bottom"===e.verticalAlign&&e.enabled&&!e.floating?a.legendHeight+h(e.margin,10):0)-(this.titleOffset?this.titleOffset[2]:0));f&&g&&(this.inverted?f.options.left=g.options.left=c.left:f.options.top=g.options.top=c.top,f.setAxisSize(),g.setAxisSize())}}),H(G,"update",function(a){var c=a.options.navigator||{},e=a.options.scrollbar||{};this.navigator|| this.scroller||!c.enabled&&!e.enabled||(r(!0,this.options.navigator,c),r(!0,this.options.scrollbar,e),delete a.options.navigator,delete a.options.scrollbar)}),H(G,"afterUpdate",function(a){this.navigator||this.scroller||!this.options.navigator.enabled&&!this.options.scrollbar.enabled||(this.scroller=this.navigator=new F(this),h(a.redraw,!0)&&this.redraw(a.animation))}),H(G,"afterAddSeries",function(){this.navigator&&this.navigator.setBaseSeries(null,!1)}),H(m,"afterUpdate",function(){this.chart.navigator&& !this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1)}),G.prototype.callbacks.push(function(a){var c=a.navigator;c&&a.xAxis[0]&&(a=a.xAxis[0].getExtremes(),c.render(a.min,a.max))}));A.Navigator=F;return A.Navigator});P(A,"parts/OrdinalAxis.js",[A["parts/Axis.js"],A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g,A){var v=A.addEvent,H=A.css,G=A.defined,N=A.pick,M=A.timeUnits;A=g.Chart;var y=g.Series,I=function(){function k(g){this.index={};this.axis=g}k.prototype.getExtendedPositions= function(){var k=this,v=k.axis,t=v.constructor.prototype,q=v.chart,r=v.series[0].currentDataGrouping,h=k.index,f=r?r.count+r.unitName:"raw",a=v.options.overscroll,l=v.getExtremes(),e;h||(h=k.index={});if(!h[f]){var c={series:[],chart:q,getExtremes:function(){return{min:l.dataMin,max:l.dataMax+a}},options:{ordinal:!0},ordinal:{},ordinal2lin:t.ordinal2lin,val2lin:t.val2lin};c.ordinal.axis=c;v.series.forEach(function(a){e={xAxis:c,xData:a.xData.slice(),chart:q,destroyGroupedData:g.noop,getProcessedData:g.Series.prototype.getProcessedData}; e.xData=e.xData.concat(k.getOverscrollPositions());e.options={dataGrouping:r?{enabled:!0,forced:!0,approximation:"open",units:[[r.unitName,[r.count]]]}:{enabled:!1}};a.processData.apply(e);c.series.push(e)});v.beforeSetTickPositions.apply(c);h[f]=c.ordinal.positions}return h[f]};k.prototype.getGroupIntervalFactor=function(g,k,t){t=t.processedXData;var q=t.length,r=[];var h=this.groupIntervalFactor;if(!h){for(h=0;h<q-1;h++)r[h]=t[h+1]-t[h];r.sort(function(f,a){return f-a});r=r[Math.floor(q/2)];g=Math.max(g, t[0]);k=Math.min(k,t[q-1]);this.groupIntervalFactor=h=q*r/(k-g)}return h};k.prototype.getOverscrollPositions=function(){var g=this.axis,k=g.options.overscroll,t=this.overscrollPointsRange,q=[],r=g.dataMax;if(G(t))for(q.push(r);r<=g.dataMax+k;)r+=t,q.push(r);return q};k.prototype.postProcessTickInterval=function(g){var k=this.axis,t=this.slope;return t?k.options.breaks?k.closestPointRange||g:g/(t/k.closestPointRange):g};return k}(),J=function(){function g(){}g.compose=function(g,k,t){g.keepProps.push("ordinal"); var q=g.prototype;q.beforeSetTickPositions=function(){var g=this.ordinal,h=[],f,a=!1,l=this.getExtremes(),e=l.min,c=l.max,m,k=this.isXAxis&&!!this.options.breaks;l=this.options.ordinal;var q=Number.MAX_VALUE,t=this.chart.options.chart.ignoreHiddenSeries,w;if(l||k){this.series.forEach(function(a,c){f=[];if(!(t&&!1===a.visible||!1===a.takeOrdinalPosition&&!k)&&(h=h.concat(a.processedXData),p=h.length,h.sort(function(a,b){return a-b}),q=Math.min(q,N(a.closestPointRange,q)),p)){for(c=0;c<p-1;)h[c]!== h[c+1]&&f.push(h[c+1]),c++;f[0]!==h[0]&&f.unshift(h[0]);h=f}a.isSeriesBoosting&&(w=!0)});w&&(h.length=0);var p=h.length;if(2<p){var C=h[1]-h[0];for(m=p-1;m--&&!a;)h[m+1]-h[m]!==C&&(a=!0);!this.options.keepOrdinalPadding&&(h[0]-e>C||c-h[h.length-1]>C)&&(a=!0)}else this.options.overscroll&&(2===p?q=h[1]-h[0]:1===p?(q=this.options.overscroll,h=[h[0],h[0]+q]):q=g.overscrollPointsRange);a?(this.options.overscroll&&(g.overscrollPointsRange=q,h=h.concat(g.getOverscrollPositions())),g.positions=h,C=this.ordinal2lin(Math.max(e, h[0]),!0),m=Math.max(this.ordinal2lin(Math.min(c,h[h.length-1]),!0),1),g.slope=c=(c-e)/(m-C),g.offset=e-C*c):(g.overscrollPointsRange=N(this.closestPointRange,g.overscrollPointsRange),g.positions=this.ordinal.slope=g.offset=void 0)}this.isOrdinal=l&&a;g.groupIntervalFactor=null};g.prototype.getTimeTicks=function(g,h,f,a,l,e,c){void 0===l&&(l=[]);void 0===e&&(e=0);var m=0,k,r,q={},w=[],p=-Number.MAX_VALUE,t=this.options.tickPixelInterval,v=this.chart.time,B=[];if(!this.options.ordinal&&!this.options.breaks|| !l||3>l.length||"undefined"===typeof h)return v.getTimeTicks.apply(v,arguments);var d=l.length;for(k=0;k<d;k++){var b=k&&l[k-1]>f;l[k]<h&&(m=k);if(k===d-1||l[k+1]-l[k]>5*e||b){if(l[k]>p){for(r=v.getTimeTicks(g,l[m],l[k],a);r.length&&r[0]<=p;)r.shift();r.length&&(p=r[r.length-1]);B.push(w.length);w=w.concat(r)}m=k+1}if(b)break}r=r.info;if(c&&r.unitRange<=M.hour){k=w.length-1;for(m=1;m<k;m++)if(v.dateFormat("%d",w[m])!==v.dateFormat("%d",w[m-1])){q[w[m]]="day";var n=!0}n&&(q[w[0]]="day");r.higherRanks= q}r.segmentStarts=B;w.info=r;if(c&&G(t)){m=B=w.length;n=[];var x;for(v=[];m--;)k=this.translate(w[m]),x&&(v[m]=x-k),n[m]=x=k;v.sort();v=v[Math.floor(v.length/2)];v<.6*t&&(v=null);m=w[B-1]>f?B-1:B;for(x=void 0;m--;)k=n[m],B=Math.abs(x-k),x&&B<.8*t&&(null===v||B<.8*v)?(q[w[m]]&&!q[w[m+1]]?(B=m+1,x=k):B=m,w.splice(B,1)):x=k}return w};q.lin2val=function(g,h){var f=this.ordinal,a=f.positions;if(a){var l=f.slope,e=f.offset;f=a.length-1;if(h)if(0>g)g=a[0];else if(g>f)g=a[f];else{f=Math.floor(g);var c=g- f}else for(;f--;)if(h=l*f+e,g>=h){l=l*(f+1)+e;c=(g-h)/(l-h);break}return"undefined"!==typeof c&&"undefined"!==typeof a[f]?a[f]+(c?c*(a[f+1]-a[f]):0):g}return g};q.val2lin=function(g,h){var f=this.ordinal,a=f.positions;if(a){var l=a.length,e;for(e=l;e--;)if(a[e]===g){var c=e;break}for(e=l-1;e--;)if(g>a[e]||0===e){g=(g-a[e])/(a[e+1]-a[e]);c=e+g;break}h=h?c:f.slope*(c||0)+f.offset}else h=g;return h};q.ordinal2lin=q.val2lin;v(g,"afterInit",function(){this.ordinal||(this.ordinal=new I(this))});v(g,"foundExtremes", function(){this.isXAxis&&G(this.options.overscroll)&&this.max===this.dataMax&&(!this.chart.mouseIsDown||this.isInternal)&&(!this.eventArgs||this.eventArgs&&"navigator"!==this.eventArgs.trigger)&&(this.max+=this.options.overscroll,!this.isInternal&&G(this.userMin)&&(this.min+=this.options.overscroll))});v(g,"afterSetScale",function(){this.horiz&&!this.isDirty&&(this.isDirty=this.isOrdinal&&this.chart.navigator&&!this.chart.navigator.adaptToUpdatedData)});v(k,"pan",function(g){var h=this.xAxis[0],f= h.options.overscroll,a=g.originalEvent.chartX,l=this.options.chart&&this.options.chart.panning,e=!1;if(l&&"y"!==l.type&&h.options.ordinal&&h.series.length){var c=this.mouseDownX,m=h.getExtremes(),k=m.dataMax,r=m.min,q=m.max,w=this.hoverPoints,p=h.closestPointRange||h.ordinal&&h.ordinal.overscrollPointsRange;c=(c-a)/(h.translationSlope*(h.ordinal.slope||p));var t={ordinal:{positions:h.ordinal.getExtendedPositions()}};p=h.lin2val;var v=h.val2lin;if(!t.ordinal.positions)e=!0;else if(1<Math.abs(c)){w&& w.forEach(function(a){a.setState()});if(0>c){w=t;var B=h.ordinal.positions?h:t}else w=h.ordinal.positions?h:t,B=t;t=B.ordinal.positions;k>t[t.length-1]&&t.push(k);this.fixedRange=q-r;c=h.navigatorAxis.toFixedRange(null,null,p.apply(w,[v.apply(w,[r,!0])+c,!0]),p.apply(B,[v.apply(B,[q,!0])+c,!0]));c.min>=Math.min(m.dataMin,r)&&c.max<=Math.max(k,q)+f&&h.setExtremes(c.min,c.max,!0,!1,{trigger:"pan"});this.mouseDownX=a;H(this.container,{cursor:"move"})}}else e=!0;e||l&&/y/.test(l.type)?f&&(h.max=h.dataMax+ f):g.preventDefault()});v(t,"updatedData",function(){var g=this.xAxis;g&&g.options.ordinal&&delete g.ordinal.index})};return g}();J.compose(k,A,y);return J});P(A,"modules/broken-axis.src.js",[A["parts/Axis.js"],A["parts/Globals.js"],A["parts/Utilities.js"],A["parts/Stacking.js"]],function(k,g,A,v){var H=A.addEvent,G=A.find,N=A.fireEvent,M=A.isArray,y=A.isNumber,I=A.pick,J=g.Series,E=function(){function g(g){this.hasBreaks=!1;this.axis=g}g.isInBreak=function(g,k){var q=g.repeat||Infinity,r=g.from, h=g.to-g.from;k=k>=r?(k-r)%q:q-(r-k)%q;return g.inclusive?k<=h:k<h&&0!==k};g.lin2Val=function(k){var t=this.brokenAxis;t=t&&t.breakArray;if(!t)return k;var q;for(q=0;q<t.length;q++){var r=t[q];if(r.from>=k)break;else r.to<k?k+=r.len:g.isInBreak(r,k)&&(k+=r.len)}return k};g.val2Lin=function(k){var t=this.brokenAxis;t=t&&t.breakArray;if(!t)return k;var q=k,r;for(r=0;r<t.length;r++){var h=t[r];if(h.to<=k)q-=h.len;else if(h.from>=k)break;else if(g.isInBreak(h,k)){q-=k-h.from;break}}return q};g.prototype.findBreakAt= function(g,k){return G(k,function(k){return k.from<g&&g<k.to})};g.prototype.isInAnyBreak=function(k,t){var q=this.axis,r=q.options.breaks,h=r&&r.length,f;if(h){for(;h--;)if(g.isInBreak(r[h],k)){var a=!0;f||(f=I(r[h].showPoints,!q.isXAxis))}var l=a&&t?a&&!f:a}return l};g.prototype.setBreaks=function(v,t){var q=this,r=q.axis,h=M(v)&&!!v.length;r.isDirty=q.hasBreaks!==h;q.hasBreaks=h;r.options.breaks=r.userOptions.breaks=v;r.forceRedraw=!0;r.series.forEach(function(f){f.isDirty=!0});h||r.val2lin!==g.val2Lin|| (delete r.val2lin,delete r.lin2val);h&&(r.userOptions.ordinal=!1,r.lin2val=g.lin2Val,r.val2lin=g.val2Lin,r.setExtremes=function(f,a,h,e,c){if(q.hasBreaks){for(var g,l=this.options.breaks;g=q.findBreakAt(f,l);)f=g.to;for(;g=q.findBreakAt(a,l);)a=g.from;a<f&&(a=f)}k.prototype.setExtremes.call(this,f,a,h,e,c)},r.setAxisTranslation=function(f){k.prototype.setAxisTranslation.call(this,f);q.unitLength=null;if(q.hasBreaks){f=r.options.breaks||[];var a=[],h=[],e=0,c,m=r.userMin||r.min,u=r.userMax||r.max, t=I(r.pointRangePadding,0),v;f.forEach(function(a){c=a.repeat||Infinity;g.isInBreak(a,m)&&(m+=a.to%c-m%c);g.isInBreak(a,u)&&(u-=u%c-a.from%c)});f.forEach(function(e){p=e.from;for(c=e.repeat||Infinity;p-c>m;)p-=c;for(;p<m;)p+=c;for(v=p;v<u;v+=c)a.push({value:v,move:"in"}),a.push({value:v+(e.to-e.from),move:"out",size:e.breakSize})});a.sort(function(a,c){return a.value===c.value?("in"===a.move?0:1)-("in"===c.move?0:1):a.value-c.value});var w=0;var p=m;a.forEach(function(a){w+="in"===a.move?1:-1;1=== w&&"in"===a.move&&(p=a.value);0===w&&(h.push({from:p,to:a.value,len:a.value-p-(a.size||0)}),e+=a.value-p-(a.size||0))});r.breakArray=q.breakArray=h;q.unitLength=u-m-e+t;N(r,"afterBreaks");r.staticScale?r.transA=r.staticScale:q.unitLength&&(r.transA*=(u-r.min+t)/q.unitLength);t&&(r.minPixelPadding=r.transA*r.minPointOffset);r.min=m;r.max=u}});I(t,!0)&&r.chart.redraw()};return g}();g=function(){function g(){}g.compose=function(g,k){g.keepProps.push("brokenAxis");var q=J.prototype;q.drawBreaks=function(g, h){var f=this,a=f.points,k,e,c,m;if(g&&g.brokenAxis&&g.brokenAxis.hasBreaks){var u=g.brokenAxis;h.forEach(function(h){k=u&&u.breakArray||[];e=g.isXAxis?g.min:I(f.options.threshold,g.min);a.forEach(function(a){m=I(a["stack"+h.toUpperCase()],a[h]);k.forEach(function(f){if(y(e)&&y(m)){c=!1;if(e<f.from&&m>f.to||e>f.from&&m<f.from)c="pointBreak";else if(e<f.from&&m>f.from&&m<f.to||e>f.from&&m>f.to&&m<f.from)c="pointInBreak";c&&N(g,c,{point:a,brk:f})}})})})}};q.gappedPath=function(){var g=this.currentDataGrouping, h=g&&g.gapSize;g=this.options.gapSize;var f=this.points.slice(),a=f.length-1,k=this.yAxis,e;if(g&&0<a)for("value"!==this.options.gapUnit&&(g*=this.basePointRange),h&&h>g&&h>=this.basePointRange&&(g=h),e=void 0;a--;)e&&!1!==e.visible||(e=f[a+1]),h=f[a],!1!==e.visible&&!1!==h.visible&&(e.x-h.x>g&&(e=(h.x+e.x)/2,f.splice(a+1,0,{isNull:!0,x:e}),k.stacking&&this.options.stacking&&(e=k.stacking.stacks[this.stackKey][e]=new v(k,k.options.stackLabels,!1,e,this.stack),e.total=0)),e=h);return this.getGraphPath(f)}; H(g,"init",function(){this.brokenAxis||(this.brokenAxis=new E(this))});H(g,"afterInit",function(){"undefined"!==typeof this.brokenAxis&&this.brokenAxis.setBreaks(this.options.breaks,!1)});H(g,"afterSetTickPositions",function(){var g=this.brokenAxis;if(g&&g.hasBreaks){var h=this.tickPositions,f=this.tickPositions.info,a=[],k;for(k=0;k<h.length;k++)g.isInAnyBreak(h[k])||a.push(h[k]);this.tickPositions=a;this.tickPositions.info=f}});H(g,"afterSetOptions",function(){this.brokenAxis&&this.brokenAxis.hasBreaks&& (this.options.ordinal=!1)});H(k,"afterGeneratePoints",function(){var g=this.options.connectNulls,h=this.points,f=this.xAxis,a=this.yAxis;if(this.isDirty)for(var k=h.length;k--;){var e=h[k],c=!(null===e.y&&!1===g)&&(f&&f.brokenAxis&&f.brokenAxis.isInAnyBreak(e.x,!0)||a&&a.brokenAxis&&a.brokenAxis.isInAnyBreak(e.y,!0));e.visible=c?!1:!1!==e.options.visible}});H(k,"afterRender",function(){this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,I(this.pointArrayMap,["y"]))})};return g}();g.compose(k, J);return g});P(A,"masters/modules/broken-axis.src.js",[],function(){});P(A,"parts/DataGrouping.js",[A["parts/DateTimeAxis.js"],A["parts/Globals.js"],A["parts/Point.js"],A["parts/Tooltip.js"],A["parts/Utilities.js"]],function(k,g,A,v,K){"";var G=K.addEvent,H=K.arrayMax,M=K.arrayMin,y=K.correctFloat,I=K.defined,J=K.error,E=K.extend,D=K.format,z=K.isNumber,t=K.merge,q=K.pick,r=g.Axis,h=g.defaultPlotOptions;K=g.Series;var f=g.approximations={sum:function(a){var c=a.length;if(!c&&a.hasNulls)var e=null; else if(c)for(e=0;c--;)e+=a[c];return e},average:function(a){var c=a.length;a=f.sum(a);z(a)&&c&&(a=y(a/c));return a},averages:function(){var a=[];[].forEach.call(arguments,function(c){a.push(f.average(c))});return"undefined"===typeof a[0]?void 0:a},open:function(a){return a.length?a[0]:a.hasNulls?null:void 0},high:function(a){return a.length?H(a):a.hasNulls?null:void 0},low:function(a){return a.length?M(a):a.hasNulls?null:void 0},close:function(a){return a.length?a[a.length-1]:a.hasNulls?null:void 0}, ohlc:function(a,c,e,g){a=f.open(a);c=f.high(c);e=f.low(e);g=f.close(g);if(z(a)||z(c)||z(e)||z(g))return[a,c,e,g]},range:function(a,c){a=f.low(a);c=f.high(c);if(z(a)||z(c))return[a,c];if(null===a&&null===c)return null}},a=function(a,c,e,g){var h=this,d=h.data,b=h.options&&h.options.data,m=[],k=[],l=[],p=a.length,u=!!c,r=[],q=h.pointArrayMap,w=q&&q.length,v=["x"].concat(q||["y"]),C=0,F=0,y;g="function"===typeof g?g:f[g]?f[g]:f[h.getDGApproximation&&h.getDGApproximation()||"average"];w?q.forEach(function(){r.push([])}): r.push([]);var A=w||1;for(y=0;y<=p&&!(a[y]>=e[0]);y++);for(y;y<=p;y++){for(;"undefined"!==typeof e[C+1]&&a[y]>=e[C+1]||y===p;){var D=e[C];h.dataGroupInfo={start:h.cropStart+F,length:r[0].length};var G=g.apply(h,r);h.pointClass&&!I(h.dataGroupInfo.options)&&(h.dataGroupInfo.options=t(h.pointClass.prototype.optionsToObject.call({series:h},h.options.data[h.cropStart+F])),v.forEach(function(a){delete h.dataGroupInfo.options[a]}));"undefined"!==typeof G&&(m.push(D),k.push(G),l.push(h.dataGroupInfo));F= y;for(D=0;D<A;D++)r[D].length=0,r[D].hasNulls=!1;C+=1;if(y===p)break}if(y===p)break;if(q)for(D=h.cropStart+y,G=d&&d[D]||h.pointClass.prototype.applyOptions.apply({series:h},[b[D]]),D=0;D<w;D++){var L=G[q[D]];z(L)?r[D].push(L):null===L&&(r[D].hasNulls=!0)}else D=u?c[y]:null,z(D)?r[0].push(D):null===D&&(r[0].hasNulls=!0)}return{groupedXData:m,groupedYData:k,groupMap:l}},l={approximations:f,groupData:a},e=K.prototype,c=e.processData,m=e.generatePoints,u={groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L", "%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},L={line:{},spline:{},area:{},areaspline:{},arearange:{},column:{groupPixelWidth:10},columnrange:{groupPixelWidth:10}, candlestick:{groupPixelWidth:10},ohlc:{groupPixelWidth:5}},F=g.defaultDataGroupingUnits=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]];e.getDGApproximation=function(){return this.is("arearange")?"range":this.is("ohlc")?"ohlc":this.is("column")?"sum":"average"};e.groupData=a;e.processData=function(){var a=this.chart,f=this.options.dataGrouping,h=!1!==this.allowDG&& f&&q(f.enabled,a.options.isStock),g=this.visible||!a.options.chart.ignoreHiddenSeries,m,d=this.currentDataGrouping,b=!1;this.forceCrop=h;this.groupPixelWidth=null;this.hasProcessed=!0;h&&!this.requireSorting&&(this.requireSorting=b=!0);h=!1===c.apply(this,arguments)||!h;b&&(this.requireSorting=!1);if(!h){this.destroyGroupedData();h=f.groupAll?this.xData:this.processedXData;var l=f.groupAll?this.yData:this.processedYData,u=a.plotSizeX;a=this.xAxis;var r=a.options.ordinal,t=this.groupPixelWidth=a.getGroupPixelWidth&& a.getGroupPixelWidth();if(t){this.isDirty=m=!0;this.points=null;b=a.getExtremes();var v=b.min;b=b.max;r=r&&a.ordinal&&a.ordinal.getGroupIntervalFactor(v,b,this)||1;t=t*(b-v)/u*r;u=a.getTimeTicks(k.AdditionsClass.prototype.normalizeTimeTickInterval(t,f.units||F),Math.min(v,h[0]),Math.max(b,h[h.length-1]),a.options.startOfWeek,h,this.closestPointRange);l=e.groupData.apply(this,[h,l,u,f.approximation]);h=l.groupedXData;r=l.groupedYData;var y=0;if(f.smoothed&&h.length){var z=h.length-1;for(h[z]=Math.min(h[z], b);z--&&0<z;)h[z]+=t/2;h[0]=Math.max(h[0],v)}for(z=1;z<u.length;z++)u.info.segmentStarts&&-1!==u.info.segmentStarts.indexOf(z)||(y=Math.max(u[z]-u[z-1],y));v=u.info;v.gapSize=y;this.closestPointRange=u.info.totalRange;this.groupMap=l.groupMap;if(I(h[0])&&h[0]<a.min&&g){if(!I(a.options.min)&&a.min<=a.dataMin||a.min===a.dataMin)a.min=Math.min(h[0],a.min);a.dataMin=Math.min(h[0],a.dataMin)}f.groupAll&&(f=this.cropData(h,r,a.min,a.max,1),h=f.xData,r=f.yData);this.processedXData=h;this.processedYData= r}else this.groupMap=null;this.hasGroupedData=m;this.currentDataGrouping=v;this.preventGraphAnimation=(d&&d.totalRange)!==(v&&v.totalRange)}};e.destroyGroupedData=function(){this.groupedData&&(this.groupedData.forEach(function(a,c){a&&(this.groupedData[c]=a.destroy?a.destroy():null)},this),this.groupedData.length=0)};e.generatePoints=function(){m.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};G(A,"update",function(){if(this.dataGroup)return J(24,!1,this.series.chart), !1});G(v,"headerFormatter",function(a){var c=this.chart,e=c.time,f=a.labelConfig,h=f.series,d=h.tooltipOptions,b=h.options.dataGrouping,g=d.xDateFormat,m=h.xAxis,k=d[(a.isFooter?"footer":"header")+"Format"];if(m&&"datetime"===m.options.type&&b&&z(f.key)){var l=h.currentDataGrouping;b=b.dateTimeLabelFormats||u.dateTimeLabelFormats;if(l)if(d=b[l.unitName],1===l.count)g=d[0];else{g=d[1];var r=d[2]}else!g&&b&&(g=this.getXDateFormat(f,d,m));g=e.dateFormat(g,f.key);r&&(g+=e.dateFormat(r,f.key+l.totalRange- 1));h.chart.styledMode&&(k=this.styledModeFormat(k));a.text=D(k,{point:E(f.point,{key:g}),series:h},c);a.preventDefault()}});G(K,"destroy",e.destroyGroupedData);G(K,"afterSetOptions",function(a){a=a.options;var c=this.type,e=this.chart.options.plotOptions,f=h[c].dataGrouping,g=this.useCommonDataGrouping&&u;if(L[c]||g)f||(f=t(u,L[c])),a.dataGrouping=t(g,f,e.series&&e.series.dataGrouping,e[c].dataGrouping,this.userOptions.dataGrouping)});G(r,"afterSetScale",function(){this.series.forEach(function(a){a.hasProcessed= !1})});r.prototype.getGroupPixelWidth=function(){var a=this.series,c=a.length,e,f=0,h=!1,d;for(e=c;e--;)(d=a[e].options.dataGrouping)&&(f=Math.max(f,q(d.groupPixelWidth,u.groupPixelWidth)));for(e=c;e--;)(d=a[e].options.dataGrouping)&&a[e].hasProcessed&&(c=(a[e].processedXData||a[e].data).length,a[e].groupPixelWidth||c>this.chart.plotSizeX/f||c&&d.forced)&&(h=!0);return h?f:0};r.prototype.setDataGrouping=function(a,c){var e;c=q(c,!0);a||(a={forced:!1,units:null});if(this instanceof r)for(e=this.series.length;e--;)this.series[e].update({dataGrouping:a}, !1);else this.chart.options.series.forEach(function(c){c.dataGrouping=a},!1);this.ordinal&&(this.ordinal.slope=void 0);c&&this.chart.redraw()};g.dataGrouping=l;"";return l});P(A,"parts/OHLCSeries.js",[A["parts/Globals.js"],A["parts/Point.js"],A["parts/Utilities.js"]],function(k,g,A){A=A.seriesType;var v=k.seriesTypes;A("ohlc","column",{lineWidth:1,tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span> <b> {series.name}</b><br/>Open: {point.open}<br/>High: {point.high}<br/>Low: {point.low}<br/>Close: {point.close}<br/>'}, threshold:null,states:{hover:{lineWidth:3}},stickyTracking:!0},{directTouch:!1,pointArrayMap:["open","high","low","close"],toYData:function(g){return[g.open,g.high,g.low,g.close]},pointValKey:"close",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},init:function(){v.column.prototype.init.apply(this,arguments);this.options.stacking=void 0},pointAttribs:function(g,k){k=v.column.prototype.pointAttribs.call(this,g,k);var A=this.options;delete k.fill;!g.options.color&&A.upColor&&g.open<g.close&& (k.stroke=A.upColor);return k},translate:function(){var g=this,k=g.yAxis,A=!!g.modifyValue,H=["plotOpen","plotHigh","plotLow","plotClose","yBottom"];v.column.prototype.translate.apply(g);g.points.forEach(function(v){[v.open,v.high,v.low,v.close,v.low].forEach(function(y,G){null!==y&&(A&&(y=g.modifyValue(y)),v[H[G]]=k.toPixels(y,!0))});v.tooltipPos[1]=v.plotHigh+k.pos-g.chart.plotTop})},drawPoints:function(){var g=this,k=g.chart,v=function(g,k,v){var y=g[0];g=g[1];"number"===typeof y[2]&&(y[2]=Math.max(v+ k,y[2]));"number"===typeof g[2]&&(g[2]=Math.min(v-k,g[2]))};g.points.forEach(function(A){var y=A.graphic,G=!y;if("undefined"!==typeof A.plotY){y||(A.graphic=y=k.renderer.path().add(g.group));k.styledMode||y.attr(g.pointAttribs(A,A.selected&&"select"));var H=y.strokeWidth();var E=H%2/2;var D=Math.round(A.plotX)-E;var z=Math.round(A.shapeArgs.width/2);var t=[["M",D,Math.round(A.yBottom)],["L",D,Math.round(A.plotHigh)]];if(null!==A.open){var q=Math.round(A.plotOpen)+E;t.push(["M",D,q],["L",D-z,q]);v(t, H/2,q)}null!==A.close&&(q=Math.round(A.plotClose)+E,t.push(["M",D,q],["L",D+z,q]),v(t,H/2,q));y[G?"attr":"animate"]({d:t}).addClass(A.getClassName(),!0)}})},animate:null},{getClassName:function(){return g.prototype.getClassName.call(this)+(this.open<this.close?" highcharts-point-up":" highcharts-point-down")}});""});P(A,"parts/CandlestickSeries.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var A=g.merge;g=g.seriesType;var v=k.defaultPlotOptions,K=k.seriesTypes;g("candlestick", "ohlc",A(v.column,{states:{hover:{lineWidth:2}},tooltip:v.ohlc.tooltip,threshold:null,lineColor:"#000000",lineWidth:1,upColor:"#ffffff",stickyTracking:!0}),{pointAttribs:function(g,k){var v=K.column.prototype.pointAttribs.call(this,g,k),y=this.options,A=g.open<g.close,G=y.lineColor||this.color;v["stroke-width"]=y.lineWidth;v.fill=g.options.color||(A?y.upColor||this.color:this.color);v.stroke=g.options.lineColor||(A?y.upLineColor||G:G);k&&(g=y.states[k],v.fill=g.color||v.fill,v.stroke=g.lineColor|| v.stroke,v["stroke-width"]=g.lineWidth||v["stroke-width"]);return v},drawPoints:function(){var g=this,k=g.chart,v=g.yAxis.reversed;g.points.forEach(function(y){var A=y.graphic,G=!A;if("undefined"!==typeof y.plotY){A||(y.graphic=A=k.renderer.path().add(g.group));g.chart.styledMode||A.attr(g.pointAttribs(y,y.selected&&"select")).shadow(g.options.shadow);var E=A.strokeWidth()%2/2;var D=Math.round(y.plotX)-E;var z=y.plotOpen;var t=y.plotClose;var q=Math.min(z,t);z=Math.max(z,t);var r=Math.round(y.shapeArgs.width/ 2);t=v?z!==y.yBottom:Math.round(q)!==Math.round(y.plotHigh);var h=v?Math.round(q)!==Math.round(y.plotHigh):z!==y.yBottom;q=Math.round(q)+E;z=Math.round(z)+E;E=[];E.push(["M",D-r,z],["L",D-r,q],["L",D+r,q],["L",D+r,z],["Z"],["M",D,q],["L",D,t?Math.round(v?y.yBottom:y.plotHigh):q],["M",D,z],["L",D,h?Math.round(v?y.plotHigh:y.yBottom):z]);A[G?"attr":"animate"]({d:E}).addClass(y.getClassName(),!0)}})}});""});P(A,"mixins/on-series.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){var A= g.defined,v=g.stableSort,K=k.seriesTypes;return{getPlotBox:function(){return k.Series.prototype.getPlotBox.call(this.options.onSeries&&this.chart.get(this.options.onSeries)||this)},translate:function(){K.column.prototype.translate.apply(this);var g=this,k=g.options,H=g.chart,y=g.points,I=y.length-1,J,E=k.onSeries;E=E&&H.get(E);k=k.onKey||"y";var D=E&&E.options.step,z=E&&E.points,t=z&&z.length,q=H.inverted,r=g.xAxis,h=g.yAxis,f=0,a;if(E&&E.visible&&t){f=(E.pointXOffset||0)+(E.barW||0)/2;H=E.currentDataGrouping; var l=z[t-1].x+(H?H.totalRange:0);v(y,function(a,c){return a.x-c.x});for(k="plot"+k[0].toUpperCase()+k.substr(1);t--&&y[I];){var e=z[t];H=y[I];H.y=e.y;if(e.x<=H.x&&"undefined"!==typeof e[k]){if(H.x<=l&&(H.plotY=e[k],e.x<H.x&&!D&&(a=z[t+1])&&"undefined"!==typeof a[k])){var c=(H.x-e.x)/(a.x-e.x);H.plotY+=c*(a[k]-e[k]);H.y+=c*(a.y-e.y)}I--;t++;if(0>I)break}}}y.forEach(function(a,c){a.plotX+=f;if("undefined"===typeof a.plotY||q)0<=a.plotX&&a.plotX<=r.len?q?(a.plotY=r.translate(a.x,0,1,0,1),a.plotX=A(a.y)? h.translate(a.y,0,0,0,1):0):a.plotY=(r.opposite?0:g.yAxis.len)+r.offset:a.shapeArgs={};if((J=y[c-1])&&J.plotX===a.plotX){"undefined"===typeof J.stackIndex&&(J.stackIndex=0);var e=J.stackIndex+1}a.stackIndex=e});this.onSeries=E}}});P(A,"parts/FlagsSeries.js",[A["parts/Globals.js"],A["parts/Utilities.js"],A["mixins/on-series.js"]],function(k,g,A){function v(g){q[g+"pin"]=function(h,f,a,k,e){var c=e&&e.anchorX;e=e&&e.anchorY;"circle"===g&&k>a&&(h-=Math.round((k-a)/2),a=k);var m=q[g](h,f,a,k);if(c&&e){var l= c;"circle"===g?l=h+a/2:(h=m[0],a=m[1],"M"===h[0]&&"L"===a[0]&&(l=(h[1]+a[1])/2));m.push(["M",l,f>e?f:f+k],["L",c,e]);m=m.concat(q.circle(c-1,e-1,2,2))}return m}}var H=g.addEvent,G=g.defined,N=g.isNumber,M=g.merge,y=g.objectEach,I=g.seriesType,J=g.wrap;g=k.noop;var E=k.Renderer,D=k.Series,z=k.TrackerMixin,t=k.VMLRenderer,q=k.SVGRenderer.prototype.symbols;I("flags","column",{pointRange:0,allowOverlapX:!1,shape:"flag",stackDistance:12,textAlign:"center",tooltip:{pointFormat:"{point.text}<br/>"},threshold:null, y:-30,fillColor:"#ffffff",lineWidth:1,states:{hover:{lineColor:"#000000",fillColor:"#ccd6eb"}},style:{fontSize:"11px",fontWeight:"bold"}},{sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:D.prototype.init,pointAttribs:function(g,h){var f=this.options,a=g&&g.color||this.color,k=f.lineColor,e=g&&g.lineWidth;g=g&&g.fillColor||f.fillColor;h&&(g=f.states[h].fillColor,k=f.states[h].lineColor,e=f.states[h].lineWidth);return{fill:g||a,stroke:k|| a,"stroke-width":e||f.lineWidth||0}},translate:A.translate,getPlotBox:A.getPlotBox,drawPoints:function(){var g=this.points,h=this.chart,f=h.renderer,a=h.inverted,l=this.options,e=l.y,c,m=this.yAxis,u={},q=[];for(c=g.length;c--;){var t=g[c];var w=(a?t.plotY:t.plotX)>this.xAxis.len;var p=t.plotX;var v=t.stackIndex;var z=t.options.shape||l.shape;var B=t.plotY;"undefined"!==typeof B&&(B=t.plotY+e-("undefined"!==typeof v&&v*l.stackDistance));t.anchorX=v?void 0:t.plotX;var d=v?void 0:t.plotY;var b="flag"!== z;v=t.graphic;"undefined"!==typeof B&&0<=p&&!w?(v||(v=t.graphic=f.label("",null,null,z,null,null,l.useHTML),h.styledMode||v.attr(this.pointAttribs(t)).css(M(l.style,t.style)),v.attr({align:b?"center":"left",width:l.width,height:l.height,"text-align":l.textAlign}).addClass("highcharts-point").add(this.markerGroup),t.graphic.div&&(t.graphic.div.point=t),h.styledMode||v.shadow(l.shadow),v.isNew=!0),0<p&&(p-=v.strokeWidth()%2),z={y:B,anchorY:d},l.allowOverlapX&&(z.x=p,z.anchorX=t.anchorX),v.attr({text:t.options.title|| l.title||"A"})[v.isNew?"attr":"animate"](z),l.allowOverlapX||(u[t.plotX]?u[t.plotX].size=Math.max(u[t.plotX].size,v.width):u[t.plotX]={align:b?.5:0,size:v.width,target:p,anchorX:p}),t.tooltipPos=[p,B+m.pos-h.plotTop]):v&&(t.graphic=v.destroy())}l.allowOverlapX||(y(u,function(a){a.plotX=a.anchorX;q.push(a)}),k.distribute(q,a?m.len:this.xAxis.len,100),g.forEach(function(a){var b=a.graphic&&u[a.plotX];b&&(a.graphic[a.graphic.isNew?"attr":"animate"]({x:b.pos+b.align*b.size,anchorX:a.anchorX}),G(b.pos)? a.graphic.isNew=!1:(a.graphic.attr({x:-9999,anchorX:-9999}),a.graphic.isNew=!0))}));l.useHTML&&J(this.markerGroup,"on",function(a){return k.SVGElement.prototype.on.apply(a.apply(this,[].slice.call(arguments,1)),[].slice.call(arguments,1))})},drawTracker:function(){var g=this.points;z.drawTrackerPoint.apply(this);g.forEach(function(h){var f=h.graphic;f&&H(f.element,"mouseover",function(){0<h.stackIndex&&!h.raised&&(h._y=f.y,f.attr({y:h._y-8}),h.raised=!0);g.forEach(function(a){a!==h&&a.raised&&a.graphic&& (a.graphic.attr({y:a._y}),a.raised=!1)})})})},animate:function(g){g&&this.setClip()},setClip:function(){D.prototype.setClip.apply(this,arguments);!1!==this.options.clip&&this.sharedClipKey&&this.markerGroup.clip(this.chart[this.sharedClipKey])},buildKDTree:g,invertGroups:g},{isValid:function(){return N(this.y)||"undefined"===typeof this.y}});q.flag=function(g,h,f,a,k){var e=k&&k.anchorX||g;k=k&&k.anchorY||h;var c=q.circle(e-1,k-1,2,2);c.push(["M",e,k],["L",g,h+a],["L",g,h],["L",g+f,h],["L",g+f,h+ a],["L",g,h+a],["Z"]);return c};v("circle");v("square");E===t&&["circlepin","flag","squarepin"].forEach(function(g){t.prototype.symbols[g]=q[g]});""});P(A,"parts/RangeSelector.js",[A["parts/Globals.js"],A["parts/Utilities.js"]],function(k,g){function A(a){this.init(a)}var v=g.addEvent,K=g.createElement,G=g.css,N=g.defined,M=g.destroyObjectProperties,y=g.discardElement,I=g.extend,J=g.fireEvent,E=g.isNumber,D=g.merge,z=g.objectEach,t=g.pick,q=g.pInt,r=g.splat,h=k.Axis;g=k.Chart;var f=k.defaultOptions; I(f,{rangeSelector:{verticalAlign:"top",buttonTheme:{width:28,height:18,padding:2,zIndex:7},floating:!1,x:0,y:0,height:void 0,inputPosition:{align:"right",x:0,y:0},buttonPosition:{align:"left",x:0,y:0},labelStyle:{color:"#666666"}}});f.lang=D(f.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});A.prototype={clickButton:function(a,f){var e=this.chart,c=this.buttonOptions[a],g=e.xAxis[0],k=e.scroller&&e.scroller.getUnionExtremes()||g||{},l=k.dataMin,q=k.dataMax,w=g&&Math.round(Math.min(g.max, t(q,g.max))),p=c.type;k=c._range;var C,y=c.dataGrouping;if(null!==l&&null!==q){e.fixedRange=k;y&&(this.forcedDataGrouping=!0,h.prototype.setDataGrouping.call(g||{chart:this.chart},y,!1),this.frozenStates=c.preserveDataGrouping);if("month"===p||"year"===p)if(g){p={range:c,max:w,chart:e,dataMin:l,dataMax:q};var B=g.minFromRange.call(p);E(p.newMax)&&(w=p.newMax)}else k=c;else if(k)B=Math.max(w-k,l),w=Math.min(B+k,q);else if("ytd"===p)if(g)"undefined"===typeof q&&(l=Number.MAX_VALUE,q=Number.MIN_VALUE, e.series.forEach(function(a){a=a.xData;l=Math.min(a[0],l);q=Math.max(a[a.length-1],q)}),f=!1),w=this.getYTDExtremes(q,l,e.time.useUTC),B=C=w.min,w=w.max;else{this.deferredYTDClick=a;return}else"all"===p&&g&&(B=l,w=q);B+=c._offsetMin;w+=c._offsetMax;this.setSelected(a);if(g)g.setExtremes(B,w,t(f,1),null,{trigger:"rangeSelectorButton",rangeSelectorButton:c});else{var d=r(e.options.xAxis)[0];var b=d.range;d.range=k;var n=d.min;d.min=C;v(e,"load",function(){d.range=b;d.min=n})}}},setSelected:function(a){this.selected= this.options.selected=a},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(a){var f=this,e=a.options.rangeSelector,c=e.buttons||[].concat(f.defaultButtons),g=e.selected,h=function(){var a=f.minInput,c=f.maxInput;a&&a.blur&&J(a,"blur");c&&c.blur&&J(c,"blur")};f.chart=a;f.options=e;f.buttons=[];f.buttonOptions=c;this.unMouseDown=v(a.container, "mousedown",h);this.unResize=v(a,"resize",h);c.forEach(f.computeButtonRange);"undefined"!==typeof g&&c[g]&&this.clickButton(g,!1);v(a,"load",function(){a.xAxis&&a.xAxis[0]&&v(a.xAxis[0],"setExtremes",function(c){this.max-this.min!==a.fixedRange&&"rangeSelectorButton"!==c.trigger&&"updatedData"!==c.trigger&&f.forcedDataGrouping&&!f.frozenStates&&this.setDataGrouping(!1,!1)})})},updateButtonStates:function(){var a=this,f=this.chart,e=f.xAxis[0],c=Math.round(e.max-e.min),g=!e.hasVisibleSeries,h=f.scroller&& f.scroller.getUnionExtremes()||e,k=h.dataMin,q=h.dataMax;f=a.getYTDExtremes(q,k,f.time.useUTC);var r=f.min,p=f.max,t=a.selected,v=E(t),B=a.options.allButtonsEnabled,d=a.buttons;a.buttonOptions.forEach(function(b,f){var h=b._range,m=b.type,l=b.count||1,n=d[f],u=0,w=b._offsetMax-b._offsetMin;b=f===t;var C=h>q-k,y=h<e.minRange,z=!1,A=!1;h=h===c;("month"===m||"year"===m)&&c+36E5>=864E5*{month:28,year:365}[m]*l-w&&c-36E5<=864E5*{month:31,year:366}[m]*l+w?h=!0:"ytd"===m?(h=p-r+w===c,z=!b):"all"===m&&(h= e.max-e.min>=q-k,A=!b&&v&&h);m=!B&&(C||y||A||g);l=b&&h||h&&!v&&!z||b&&a.frozenStates;m?u=3:l&&(v=!0,u=2);n.state!==u&&(n.setState(u),0===u&&t===f&&a.setSelected(null))})},computeButtonRange:function(a){var f=a.type,e=a.count||1,c={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(c[f])a._range=c[f]*e;else if("month"===f||"year"===f)a._range=864E5*{month:30,year:365}[f]*e;a._offsetMin=t(a.offsetMin,0);a._offsetMax=t(a.offsetMax,0);a._range+=a._offsetMax-a._offsetMin},setInputValue:function(a, f){var e=this.chart.options.rangeSelector,c=this.chart.time,g=this[a+"Input"];N(f)&&(g.previousValue=g.HCTime,g.HCTime=f);g.value=c.dateFormat(e.inputEditDateFormat||"%Y-%m-%d",g.HCTime);this[a+"DateBox"].attr({text:c.dateFormat(e.inputDateFormat||"%b %e, %Y",g.HCTime)})},showInput:function(a){var f=this.inputGroup,e=this[a+"DateBox"];G(this[a+"Input"],{left:f.translateX+e.x+"px",top:f.translateY+"px",width:e.width-2+"px",height:e.height-2+"px",border:"2px solid silver"})},hideInput:function(a){G(this[a+ "Input"],{border:0,width:"1px",height:"1px"});this.setInputValue(a)},drawInput:function(a){function g(){var a=p.value,d=(r.inputDateParser||Date.parse)(a),b=c.xAxis[0],f=c.scroller&&c.scroller.xAxis?c.scroller.xAxis:b,g=f.dataMin;f=f.dataMax;d!==p.previousValue&&(p.previousValue=d,E(d)||(d=a.split("-"),d=Date.UTC(q(d[0]),q(d[1])-1,q(d[2]))),E(d)&&(c.time.useUTC||(d+=6E4*(new Date).getTimezoneOffset()),w?d>e.maxInput.HCTime?d=void 0:d<g&&(d=g):d<e.minInput.HCTime?d=void 0:d>f&&(d=f),"undefined"!== typeof d&&b.setExtremes(w?d:b.min,w?b.max:d,void 0,void 0,{trigger:"rangeSelectorInput"})))}var e=this,c=e.chart,h=c.renderer.style||{},u=c.renderer,r=c.options.rangeSelector,t=e.div,w="min"===a,p,v,y=this.inputGroup;this[a+"Label"]=v=u.label(f.lang[w?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).addClass("highcharts-range-label").attr({padding:2}).add(y);y.offset+=v.width+5;this[a+"DateBox"]=u=u.label("",y.offset).addClass("highcharts-range-input").attr({padding:2,width:r.inputBoxWidth|| 90,height:r.inputBoxHeight||17,"text-align":"center"}).on("click",function(){e.showInput(a);e[a+"Input"].focus()});c.styledMode||u.attr({stroke:r.inputBoxBorderColor||"#cccccc","stroke-width":1});u.add(y);y.offset+=u.width+(w?10:0);this[a+"Input"]=p=K("input",{name:a,className:"highcharts-range-selector",type:"text"},{top:c.plotTop+"px"},t);c.styledMode||(v.css(D(h,r.labelStyle)),u.css(D({color:"#333333"},h,r.inputStyle)),G(p,I({position:"absolute",border:0,width:"1px",height:"1px",padding:0,textAlign:"center", fontSize:h.fontSize,fontFamily:h.fontFamily,top:"-9999em"},r.inputStyle)));p.onfocus=function(){e.showInput(a)};p.onblur=function(){p===k.doc.activeElement&&g();e.hideInput(a);p.blur()};p.onchange=g;p.onkeypress=function(a){13===a.keyCode&&g()}},getPosition:function(){var a=this.chart,f=a.options.rangeSelector;a="top"===f.verticalAlign?a.plotTop-a.axisOffset[0]:0;return{buttonTop:a+f.buttonPosition.y,inputTop:a+f.inputPosition.y-10}},getYTDExtremes:function(a,f,e){var c=this.chart.time,g=new c.Date(a), h=c.get("FullYear",g);e=e?c.Date.UTC(h,0,1):+new c.Date(h,0,1);f=Math.max(f||0,e);g=g.getTime();return{max:Math.min(a||g,g),min:f}},render:function(a,g){var e=this,c=e.chart,h=c.renderer,k=c.container,l=c.options,q=l.exporting&&!1!==l.exporting.enabled&&l.navigation&&l.navigation.buttonOptions,r=f.lang,p=e.div,v=l.rangeSelector,y=t(l.chart.style&&l.chart.style.zIndex,0)+1;l=v.floating;var B=e.buttons;p=e.inputGroup;var d=v.buttonTheme,b=v.buttonPosition,n=v.inputPosition,x=v.inputEnabled,z=d&&d.states, A=c.plotLeft,D=e.buttonGroup,E,G=e.options.verticalAlign,H=c.legend,I=H&&H.options,J=b.y,M=n.y,N=c.hasLoaded,P=N?"animate":"attr",T=0,S=0;if(!1!==v.enabled){e.rendered||(e.group=E=h.g("range-selector-group").attr({zIndex:7}).add(),e.buttonGroup=D=h.g("range-selector-buttons").add(E),e.zoomText=h.text(r.rangeSelectorZoom,0,15).add(D),c.styledMode||(e.zoomText.css(v.labelStyle),d["stroke-width"]=t(d["stroke-width"],0)),e.buttonOptions.forEach(function(a,b){B[b]=h.button(a.text,0,0,function(c){var d= a.events&&a.events.click,f;d&&(f=d.call(a,c));!1!==f&&e.clickButton(b);e.isActive=!0},d,z&&z.hover,z&&z.select,z&&z.disabled).attr({"text-align":"center"}).add(D)}),!1!==x&&(e.div=p=K("div",null,{position:"relative",height:0,zIndex:y}),k.parentNode.insertBefore(p,k),e.inputGroup=p=h.g("input-group").add(E),p.offset=0,e.drawInput("min"),e.drawInput("max")));e.zoomText[P]({x:t(A+b.x,A)});var da=t(A+b.x,A)+e.zoomText.getBBox().width+5;e.buttonOptions.forEach(function(a,b){B[b][P]({x:da});da+=B[b].width+ t(v.buttonSpacing,5)});A=c.plotLeft-c.spacing[3];e.updateButtonStates();q&&this.titleCollision(c)&&"top"===G&&"right"===b.align&&b.y+D.getBBox().height-12<(q.y||0)+q.height&&(T=-40);k=b.x-c.spacing[3];"right"===b.align?k+=T-A:"center"===b.align&&(k-=A/2);D.align({y:b.y,width:D.getBBox().width,align:b.align,x:k},!0,c.spacingBox);e.group.placed=N;e.buttonGroup.placed=N;!1!==x&&(T=q&&this.titleCollision(c)&&"top"===G&&"right"===n.align&&n.y-p.getBBox().height-12<(q.y||0)+q.height+c.spacing[0]?-40:0, "left"===n.align?k=A:"right"===n.align&&(k=-Math.max(c.axisOffset[1],-T)),p.align({y:n.y,width:p.getBBox().width,align:n.align,x:n.x+k-2},!0,c.spacingBox),q=p.alignAttr.translateX+p.alignOptions.x-T+p.getBBox().x+2,k=p.alignOptions.width,r=D.alignAttr.translateX+D.getBBox().x,A=D.getBBox().width+20,(n.align===b.align||r+A>q&&q+k>r&&J<M+p.getBBox().height)&&p.attr({translateX:p.alignAttr.translateX+(c.axisOffset[1]>=-T?0:-T),translateY:p.alignAttr.translateY+D.getBBox().height+10}),e.setInputValue("min", a),e.setInputValue("max",g),e.inputGroup.placed=N);e.group.align({verticalAlign:G},!0,c.spacingBox);a=e.group.getBBox().height+20;g=e.group.alignAttr.translateY;"bottom"===G&&(H=I&&"bottom"===I.verticalAlign&&I.enabled&&!I.floating?H.legendHeight+t(I.margin,10):0,a=a+H-20,S=g-a-(l?0:v.y)-(c.titleOffset?c.titleOffset[2]:0)-10);if("top"===G)l&&(S=0),c.titleOffset&&c.titleOffset[0]&&(S=c.titleOffset[0]),S+=c.margin[0]-c.spacing[0]||0;else if("middle"===G)if(M===J)S=0>M?g+void 0:g;else if(M||J)S=0>M|| 0>J?S-Math.min(M,J):g-a+NaN;e.group.translate(v.x,v.y+Math.floor(S));!1!==x&&(e.minInput.style.marginTop=e.group.translateY+"px",e.maxInput.style.marginTop=e.group.translateY+"px");e.rendered=!0}},getHeight:function(){var a=this.options,f=this.group,e=a.y,c=a.buttonPosition.y,g=a.inputPosition.y;if(a.height)return a.height;a=f?f.getBBox(!0).height+13+e:0;f=Math.min(g,c);if(0>g&&0>c||0<g&&0<c)a+=Math.abs(f);return a},titleCollision:function(a){return!(a.options.title.text||a.options.subtitle.text)}, update:function(a){var f=this.chart;D(!0,f.options.rangeSelector,a);this.destroy();this.init(f);f.rangeSelector.render()},destroy:function(){var a=this,f=a.minInput,e=a.maxInput;a.unMouseDown();a.unResize();M(a.buttons);f&&(f.onfocus=f.onblur=f.onchange=null);e&&(e.onfocus=e.onblur=e.onchange=null);z(a,function(c,e){c&&"chart"!==e&&(c.destroy?c.destroy():c.nodeType&&y(this[e]));c!==A.prototype[e]&&(a[e]=null)},this)}};h.prototype.minFromRange=function(){var a=this.range,f=a.type,e=this.max,c=this.chart.time, g=function(a,e){var g="year"===f?"FullYear":"Month",h=new c.Date(a),k=c.get(g,h);c.set(g,h,k+e);k===c.get(g,h)&&c.set("Date",h,0);return h.getTime()-a};if(E(a)){var h=e-a;var k=a}else h=e+g(e,-a.count),this.chart&&(this.chart.fixedRange=e-h);var q=t(this.dataMin,Number.MIN_VALUE);E(h)||(h=q);h<=q&&(h=q,"undefined"===typeof k&&(k=g(h,a.count)),this.newMax=Math.min(h+k,this.dataMax));E(e)||(h=void 0);return h};k.RangeSelector||(v(g,"afterGetContainer",function(){this.options.rangeSelector.enabled&& (this.rangeSelector=new A(this))}),v(g,"beforeRender",function(){var a=this.axes,f=this.rangeSelector;f&&(E(f.deferredYTDClick)&&(f.clickButton(f.deferredYTDClick),delete f.deferredYTDClick),a.forEach(function(a){a.updateNames();a.setScale()}),this.getAxisMargins(),f.render(),a=f.options.verticalAlign,f.options.floating||("bottom"===a?this.extraBottomMargin=!0:"middle"!==a&&(this.extraTopMargin=!0)))}),v(g,"update",function(a){var f=a.options.rangeSelector;a=this.rangeSelector;var e=this.extraBottomMargin, c=this.extraTopMargin;f&&f.enabled&&!N(a)&&(this.options.rangeSelector.enabled=!0,this.rangeSelector=new A(this));this.extraTopMargin=this.extraBottomMargin=!1;a&&(a.render(),f=f&&f.verticalAlign||a.options&&a.options.verticalAlign,a.options.floating||("bottom"===f?this.extraBottomMargin=!0:"middle"!==f&&(this.extraTopMargin=!0)),this.extraBottomMargin!==e||this.extraTopMargin!==c)&&(this.isDirtyBox=!0)}),v(g,"render",function(){var a=this.rangeSelector;a&&!a.options.floating&&(a.render(),a=a.options.verticalAlign, "bottom"===a?this.extraBottomMargin=!0:"middle"!==a&&(this.extraTopMargin=!0))}),v(g,"getMargins",function(){var a=this.rangeSelector;a&&(a=a.getHeight(),this.extraTopMargin&&(this.plotTop+=a),this.extraBottomMargin&&(this.marginBottom+=a))}),g.prototype.callbacks.push(function(a){function f(){e=a.xAxis[0].getExtremes();g=a.legend;k=null===c||void 0===c?void 0:c.options.verticalAlign;E(e.min)&&c.render(e.min,e.max);c&&g.display&&"top"===k&&k===g.options.verticalAlign&&(h=D(a.spacingBox),h.y="vertical"=== g.options.layout?a.plotTop:h.y+c.getHeight(),g.group.placed=!1,g.align(h))}var e,c=a.rangeSelector,g,h,k;if(c){var q=v(a.xAxis[0],"afterSetExtremes",function(a){c.render(a.min,a.max)});var r=v(a,"redraw",f);f()}v(a,"destroy",function(){c&&(r(),q())})}),k.RangeSelector=A)});P(A,"parts/StockChart.js",[A["parts/Axis.js"],A["parts/Globals.js"],A["parts/Point.js"],A["parts/Utilities.js"]],function(k,g,A,v){var H=v.addEvent,G=v.arrayMax,N=v.arrayMin,M=v.clamp,y=v.defined,I=v.extend,J=v.find,E=v.format, D=v.isNumber,z=v.isString,t=v.merge,q=v.pick,r=v.splat,h=g.Chart;v=g.Series;var f=g.SVGRenderer,a=v.prototype,l=a.init,e=a.processData,c=A.prototype.tooltipFormatter;g.StockChart=g.stockChart=function(a,c,e){var f=z(a)||a.nodeName,k=arguments[f?1:0],m=k,l=k.series,u=g.getOptions(),v,d=q(k.navigator&&k.navigator.enabled,u.navigator.enabled,!0);k.xAxis=r(k.xAxis||{}).map(function(a,c){return t({minPadding:0,maxPadding:0,overscroll:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0}, u.xAxis,u.xAxis&&u.xAxis[c],a,{type:"datetime",categories:null},d?{startOnTick:!1,endOnTick:!1}:null)});k.yAxis=r(k.yAxis||{}).map(function(a,c){v=q(a.opposite,!0);return t({labels:{y:-2},opposite:v,showLastLabel:!(!a.categories&&"category"!==a.type),title:{text:null}},u.yAxis,u.yAxis&&u.yAxis[c],a)});k.series=null;k=t({chart:{panning:{enabled:!0,type:"x"},pinchType:"x"},navigator:{enabled:d},scrollbar:{enabled:q(u.scrollbar.enabled,!0)},rangeSelector:{enabled:q(u.rangeSelector.enabled,!0)},title:{text:null}, tooltip:{split:q(u.tooltip.split,!0),crosshairs:!0},legend:{enabled:!1}},k,{isStock:!0});k.series=m.series=l;return f?new h(a,k,e):new h(k,c)};H(v,"setOptions",function(a){var c;this.chart.options.isStock&&(this.is("column")||this.is("columnrange")?c={borderWidth:0,shadow:!1}:this.is("scatter")||this.is("sma")||(c={marker:{enabled:!1,radius:2}}),c&&(a.plotOptions[this.type]=t(a.plotOptions[this.type],c)))});H(k,"autoLabelAlign",function(a){var c=this.chart,e=this.options;c=c._labelPanes=c._labelPanes|| {};var f=this.options.labels;this.chart.options.isStock&&"yAxis"===this.coll&&(e=e.top+","+e.height,!c[e]&&f.enabled&&(15===f.x&&(f.x=0),"undefined"===typeof f.align&&(f.align="right"),c[e]=this,a.align="right",a.preventDefault()))});H(k,"destroy",function(){var a=this.chart,c=this.options&&this.options.top+","+this.options.height;c&&a._labelPanes&&a._labelPanes[c]===this&&delete a._labelPanes[c]});H(k,"getPlotLinePath",function(a){function c(a){var b="xAxis"===a?"yAxis":"xAxis";a=e.options[b];return D(a)? [g[b][a]]:z(a)?[g.get(a)]:f.map(function(a){return a[b]})}var e=this,f=this.isLinked&&!this.series?this.linkedParent.series:this.series,g=e.chart,h=g.renderer,k=e.left,m=e.top,l,d,b,n,r=[],t=[],v=a.translatedValue,A=a.value,E=a.force;if(g.options.isStock&&!1!==a.acrossPanes&&"xAxis"===e.coll||"yAxis"===e.coll){a.preventDefault();t=c(e.coll);var G=e.isXAxis?g.yAxis:g.xAxis;G.forEach(function(a){if(y(a.options.id)?-1===a.options.id.indexOf("navigator"):1){var b=a.isXAxis?"yAxis":"xAxis";b=y(a.options[b])? g[b][a.options[b]]:g[b][0];e===b&&t.push(a)}});var H=t.length?[]:[e.isXAxis?g.yAxis[0]:g.xAxis[0]];t.forEach(function(a){-1!==H.indexOf(a)||J(H,function(b){return b.pos===a.pos&&b.len===a.len})||H.push(a)});var I=q(v,e.translate(A,null,null,a.old));D(I)&&(e.horiz?H.forEach(function(a){var c;d=a.pos;n=d+a.len;l=b=Math.round(I+e.transB);"pass"!==E&&(l<k||l>k+e.width)&&(E?l=b=M(l,k,k+e.width):c=!0);c||r.push(["M",l,d],["L",b,n])}):H.forEach(function(a){var c;l=a.pos;b=l+a.len;d=n=Math.round(m+e.height- I);"pass"!==E&&(d<m||d>m+e.height)&&(E?d=n=M(d,m,m+e.height):c=!0);c||r.push(["M",l,d],["L",b,n])}));a.path=0<r.length?h.crispPolyLine(r,a.lineWidth||1):null}});f.prototype.crispPolyLine=function(a,c){for(var e=0;e<a.length;e+=2){var f=a[e],g=a[e+1];f[1]===g[1]&&(f[1]=g[1]=Math.round(f[1])-c%2/2);f[2]===g[2]&&(f[2]=g[2]=Math.round(f[2])+c%2/2)}return a};H(k,"afterHideCrosshair",function(){this.crossLabel&&(this.crossLabel=this.crossLabel.hide())});H(k,"afterDrawCrosshair",function(a){var c,e;if(y(this.crosshair.label)&& this.crosshair.label.enabled&&this.cross){var f=this.chart,g=this.logarithmic,h=this.options.crosshair.label,k=this.horiz,m=this.opposite,l=this.left,d=this.top,b=this.crossLabel,n=h.format,r="",t="inside"===this.options.tickPosition,v=!1!==this.crosshair.snap,z=0,A=a.e||this.cross&&this.cross.e,D=a.point;a=this.min;var G=this.max;g&&(a=g.lin2log(a),G=g.lin2log(G));g=k?"center":m?"right"===this.labelAlign?"right":"left":"left"===this.labelAlign?"left":"center";b||(b=this.crossLabel=f.renderer.label(null, null,null,h.shape||"callout").addClass("highcharts-crosshair-label"+(this.series[0]&&" highcharts-color-"+this.series[0].colorIndex)).attr({align:h.align||g,padding:q(h.padding,8),r:q(h.borderRadius,3),zIndex:2}).add(this.labelGroup),f.styledMode||b.attr({fill:h.backgroundColor||this.series[0]&&this.series[0].color||"#666666",stroke:h.borderColor||"","stroke-width":h.borderWidth||0}).css(I({color:"#ffffff",fontWeight:"normal",fontSize:"11px",textAlign:"center"},h.style)));k?(g=v?D.plotX+l:A.chartX, d+=m?0:this.height):(g=m?this.width+l:0,d=v?D.plotY+d:A.chartY);n||h.formatter||(this.dateTime&&(r="%b %d, %Y"),n="{value"+(r?":"+r:"")+"}");r=v?D[this.isXAxis?"x":"y"]:this.toValue(k?A.chartX:A.chartY);b.attr({text:n?E(n,{value:r},f):h.formatter.call(this,r),x:g,y:d,visibility:r<a||r>G?"hidden":"visible"});h=b.getBBox();if(k){if(t&&!m||!t&&m)d=b.y-h.height}else d=b.y-h.height/2;k?(c=l-h.x,e=l+this.width-h.x):(c="left"===this.labelAlign?l:0,e="right"===this.labelAlign?l+this.width:f.chartWidth);b.translateX< c&&(z=c-b.translateX);b.translateX+h.width>=e&&(z=-(b.translateX+h.width-e));b.attr({x:g+z,y:d,anchorX:k?g:this.opposite?0:f.chartWidth,anchorY:k?this.opposite?f.chartHeight:0:d+h.height/2})}});a.init=function(){l.apply(this,arguments);this.setCompare(this.options.compare)};a.setCompare=function(a){this.modifyValue="value"===a||"percent"===a?function(c,e){var f=this.compareValue;return"undefined"!==typeof c&&"undefined"!==typeof f?(c="value"===a?c-f:c/f*100-(100===this.options.compareBase?0:100), e&&(e.change=c),c):0}:null;this.userOptions.compare=a;this.chart.hasRendered&&(this.isDirty=!0)};a.processData=function(a){var c,f=-1,g=!0===this.options.compareStart?0:1;e.apply(this,arguments);if(this.xAxis&&this.processedYData){var h=this.processedXData;var k=this.processedYData;var m=k.length;this.pointArrayMap&&(f=this.pointArrayMap.indexOf(this.options.pointValKey||this.pointValKey||"y"));for(c=0;c<m-g;c++){var l=k[c]&&-1<f?k[c][f]:k[c];if(D(l)&&h[c+g]>=this.xAxis.min&&0!==l){this.compareValue= l;break}}}};H(v,"afterGetExtremes",function(a){a=a.dataExtremes;if(this.modifyValue&&a){var c=[this.modifyValue(a.dataMin),this.modifyValue(a.dataMax)];a.dataMin=N(c);a.dataMax=G(c)}});k.prototype.setCompare=function(a,c){this.isXAxis||(this.series.forEach(function(c){c.setCompare(a)}),q(c,!0)&&this.chart.redraw())};A.prototype.tooltipFormatter=function(a){var e=this.series.chart.numberFormatter;a=a.replace("{point.change}",(0<this.change?"+":"")+e(this.change,q(this.series.tooltipOptions.changeDecimals, 2)));return c.apply(this,[a])};H(v,"render",function(){var a=this.chart;if(!(a.is3d&&a.is3d()||a.polar)&&this.xAxis&&!this.xAxis.isRadial){var c=this.yAxis.len;if(this.xAxis.axisLine){var e=a.plotTop+a.plotHeight-this.yAxis.pos-this.yAxis.len,f=Math.floor(this.xAxis.axisLine.strokeWidth()/2);0<=e&&(c-=Math.max(f-e,0))}!this.clipBox&&this.animate?(this.clipBox=t(a.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=c):a[this.sharedClipKey]&&(a[this.sharedClipKey].animate({width:this.xAxis.len, height:c}),a[this.sharedClipKey+"m"]&&a[this.sharedClipKey+"m"].animate({width:this.xAxis.len}))}});H(h,"update",function(a){a=a.options;"scrollbar"in a&&this.navigator&&(t(!0,this.options.scrollbar,a.scrollbar),this.navigator.update({},!1),delete a.scrollbar)})});P(A,"masters/modules/stock.src.js",[],function(){});P(A,"masters/highstock.src.js",[A["masters/highcharts.src.js"]],function(k){k.product="Highstock";return k});A["masters/highstock.src.js"]._modules=A;return A["masters/highstock.src.js"]}); //# sourceMappingURL=highstock.js.map
/** * vee-validate vundefined * (c) 2020 Abdelrahman Awad * @license MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) : typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) : (global = global || self, factory(global.VeeValidate = {}, global.Vue)); }(this, (function (exports, vue) { 'use strict'; function isCallable(fn) { return typeof fn === 'function'; } const isObject = (obj) => obj !== null && obj && typeof obj === 'object' && !Array.isArray(obj); const RULES = {}; /** * Adds a custom validator to the list of validation rules. */ function defineRule(id, validator) { // makes sure new rules are properly formatted. guardExtend(id, validator); RULES[id] = validator; } /** * Gets an already defined rule */ function resolveRule(id) { return RULES[id]; } /** * Guards from extension violations. */ function guardExtend(id, validator) { if (isCallable(validator)) { return; } throw new Error(`Extension Error: The validator '${id}' must be a function.`); } function isLocator(value) { return isCallable(value) && !!value.__locatorRef; } /** * Checks if an tag name is a native HTML tag and not a Vue component */ function isHTMLTag(tag) { return ['input', 'textarea', 'select'].includes(tag); } function isYupValidator(value) { return value && isCallable(value.validate); } function genFieldErrorId(fieldName) { return `v_${fieldName}_error`; } const isEvent = (evt) => { if (!evt) { return false; } if (typeof Event !== 'undefined' && isCallable(Event) && evt instanceof Event) { return true; } // this is for IE /* istanbul ignore next */ if (evt && evt.srcElement) { return true; } return false; }; function normalizeEventValue(value) { if (!isEvent(value)) { return value; } const input = value.target; if (input.type === 'file' && input.files) { return Array.from(input.files); } return input.value; } function unwrap(ref) { return vue.isRef(ref) ? ref.value : ref; } function useRefsObjToComputed(refsObj) { return vue.computed(() => { return Object.keys(refsObj).reduce((acc, key) => { acc[key] = refsObj[key].value; return acc; }, {}); }); } /** * Normalizes the given rules expression. */ function normalizeRules(rules) { // if falsy value return an empty object. const acc = {}; Object.defineProperty(acc, '_$$isNormalized', { value: true, writable: false, enumerable: false, configurable: false, }); if (!rules) { return acc; } // If its a single validate function or a yup fn, leave as is. if (isCallable(rules) || isYupValidator(rules)) { return rules; } // Object is already normalized, skip. if (isObject(rules) && rules._$$isNormalized) { return rules; } if (isObject(rules)) { return Object.keys(rules).reduce((prev, curr) => { const params = normalizeParams(rules[curr]); if (rules[curr] !== false) { prev[curr] = buildParams(params); } return prev; }, acc); } /* istanbul ignore if */ if (typeof rules !== 'string') { return acc; } return rules.split('|').reduce((prev, rule) => { const parsedRule = parseRule(rule); if (!parsedRule.name) { return prev; } prev[parsedRule.name] = buildParams(parsedRule.params); return prev; }, acc); } /** * Normalizes a rule param. */ function normalizeParams(params) { if (params === true) { return []; } if (Array.isArray(params)) { return params; } if (isObject(params)) { return params; } return [params]; } function buildParams(provided) { const mapValueToLocator = (value) => { // A target param using interpolation if (typeof value === 'string' && value[0] === '@') { return createLocator(value.slice(1)); } return value; }; if (Array.isArray(provided)) { return provided.map(mapValueToLocator); } return Object.keys(provided).reduce((prev, key) => { prev[key] = mapValueToLocator(provided[key]); return prev; }, {}); } /** * Parses a rule string expression. */ const parseRule = (rule) => { let params = []; const name = rule.split(':')[0]; if (rule.includes(':')) { params = rule.split(':').slice(1).join(':').split(','); } return { name, params }; }; function createLocator(value) { const locator = (crossTable) => { const val = crossTable[value]; return val; }; locator.__locatorRef = value; return locator; } function extractLocators(params) { if (Array.isArray(params)) { return params.filter(isLocator); } return Object.keys(params) .filter(key => isLocator(params[key])) .map(key => params[key]); } const normalizeChildren = (context, slotProps) => { if (!context.slots.default) { return []; } return context.slots.default(slotProps) || []; }; const DEFAULT_CONFIG = { generateMessage: ({ field }) => `${field} is not valid.`, skipOptional: true, bails: true, }; let currentConfig = Object.assign({}, DEFAULT_CONFIG); const getConfig = () => currentConfig; const setConfig = (newConf) => { currentConfig = Object.assign(Object.assign({}, currentConfig), newConf); }; const configure = (cfg) => { setConfig(cfg); }; /** * Validates a value against the rules. */ async function validate(value, rules, options = {}) { const shouldBail = options === null || options === void 0 ? void 0 : options.bails; const skipIfEmpty = options === null || options === void 0 ? void 0 : options.skipIfEmpty; const field = { name: (options === null || options === void 0 ? void 0 : options.name) || '{field}', rules: normalizeRules(rules), bails: shouldBail !== null && shouldBail !== void 0 ? shouldBail : true, skipIfEmpty: skipIfEmpty !== null && skipIfEmpty !== void 0 ? skipIfEmpty : true, forceRequired: false, crossTable: (options === null || options === void 0 ? void 0 : options.values) || {}, }; const result = await _validate(field, value); const errors = result.errors; return { errors, }; } /** * Starts the validation process. */ async function _validate(field, value) { // if a generic function, use it as the pipeline. if (isCallable(field.rules)) { const result = await field.rules(value); const isValid = typeof result !== 'string' && result; return { errors: !isValid ? [result] : [], }; } if (isYupValidator(field.rules)) { return validateFieldWithYup(field, value); } const errors = []; const rules = Object.keys(field.rules); const length = rules.length; for (let i = 0; i < length; i++) { const rule = rules[i]; const result = await _test(field, value, { name: rule, params: field.rules[rule], }); if (result.error) { errors.push(result.error); if (field.bails) { return { errors, }; } } } return { errors, }; } /** * Handles yup validation */ async function validateFieldWithYup(field, value) { const result = await field.rules .validate(value) .then(() => true) .catch((err) => { // Yup errors have a name prop one them. // https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string if (err.name === 'ValidationError') { return err.message; } // re-throw the error so we don't hide it throw err; }); const isValid = typeof result !== 'string' && result; return { errors: !isValid ? [result] : [], }; } /** * Tests a single input value against a rule. */ async function _test(field, value, rule) { const validator = resolveRule(rule.name); if (!validator) { throw new Error(`No such validator '${rule.name}' exists.`); } const params = fillTargetValues(rule.params, field.crossTable); const ctx = { field: field.name, value, form: field.crossTable, rule, }; const result = await validator(value, params, ctx); if (typeof result === 'string') { return { error: result, }; } return { error: result ? undefined : _generateFieldError(ctx), }; } /** * Generates error messages. */ function _generateFieldError(fieldCtx) { const message = getConfig().generateMessage; return message(fieldCtx); } function fillTargetValues(params, crossTable) { const normalize = (value) => { if (isLocator(value)) { return value(crossTable); } return value; }; if (Array.isArray(params)) { return params.map(normalize); } return Object.keys(params).reduce((acc, param) => { acc[param] = normalize(params[param]); return acc; }, {}); } /** * Creates a field composite. */ function useField(fieldName, rules, opts) { const { value, form, immediate, bails, disabled } = normalizeOptions(opts); const { meta, errors, onBlur, handleChange, reset, patch } = useValidationState(value); const nonYupSchemaRules = extractRuleFromSchema(form === null || form === void 0 ? void 0 : form.schema, unwrap(fieldName)); const normalizedRules = vue.computed(() => { return normalizeRules(nonYupSchemaRules || unwrap(rules)); }); const runValidation = async () => { var _a; meta.pending.value = true; if (!form || !form.validateSchema) { const result = await validate(value.value, normalizedRules.value, { name: unwrap(fieldName), values: (_a = form === null || form === void 0 ? void 0 : form.values.value) !== null && _a !== void 0 ? _a : {}, bails, }); // Must be updated regardless if a mutation is needed or not // FIXME: is this needed? meta.valid.value = !result.errors.length; meta.invalid.value = !!result.errors.length; meta.pending.value = false; return result; } const results = await form.validateSchema(); meta.pending.value = false; return results[unwrap(fieldName)]; }; const runValidationWithMutation = () => runValidation().then(patch); vue.onMounted(() => { runValidation().then(result => { if (immediate) { patch(result); } }); }); const errorMessage = vue.computed(() => { return errors.value[0]; }); const aria = useAriAttrs(fieldName, meta); const field = { name: fieldName, value: value, meta, errors, errorMessage, aria, reset, validate: runValidationWithMutation, handleChange, onBlur, disabled, setValidationState: patch, }; vue.watch(value, runValidationWithMutation, { deep: true, }); if (vue.isRef(rules)) { vue.watch(rules, runValidationWithMutation, { deep: true, }); } // if no associated form return the field API immediately if (!form) { return field; } // associate the field with the given form form.register(field); // extract cross-field dependencies in a computed prop const dependencies = vue.computed(() => { const rulesVal = normalizedRules.value; // is falsy, a function schema or a yup schema if (!rulesVal || isCallable(rulesVal) || isCallable(rulesVal.validate)) { return []; } return Object.keys(rulesVal).reduce((acc, rule) => { const deps = extractLocators(normalizedRules.value[rule]).map((dep) => dep.__locatorRef); acc.push(...deps); return acc; }, []); }); // Adds a watcher that runs the validation whenever field dependencies change vue.watchEffect(() => { // Skip if no dependencies if (!dependencies.value.length) { return; } // For each dependent field, validate it if it was validated before dependencies.value.forEach(dep => { if (dep in form.values.value && meta.validated.value) { runValidationWithMutation(); } }); }); return field; } /** * Normalizes partial field options to include the full */ function normalizeOptions(opts) { const form = vue.inject('$_veeForm', undefined); const defaults = () => ({ value: vue.ref(undefined), immediate: false, bails: true, rules: '', disabled: false, form, }); if (!opts) { return defaults(); } return Object.assign(Object.assign({}, defaults()), (opts || {})); } /** * Manages the validation state of a field. */ function useValidationState(value) { const errors = vue.ref([]); const { onBlur, reset: resetFlags, meta } = useMeta(); const initialValue = value.value; // Common input/change event handler const handleChange = (e) => { value.value = normalizeEventValue(e); meta.dirty.value = true; meta.pristine.value = false; }; // Updates the validation state with the validation result function patch(result) { errors.value = result.errors; meta.changed.value = initialValue !== value.value; meta.valid.value = !result.errors.length; meta.invalid.value = !!result.errors.length; meta.validated.value = true; return result; } // Resets the validation state const reset = () => { errors.value = []; resetFlags(); }; return { meta, errors, patch, reset, onBlur, handleChange, }; } /** * Exposes meta flags state and some associated actions with them. */ function useMeta() { const initialMeta = () => ({ untouched: true, touched: false, dirty: false, pristine: true, valid: false, invalid: false, validated: false, pending: false, changed: false, passed: false, failed: false, }); const flags = vue.reactive(initialMeta()); const passed = vue.computed(() => { return flags.valid && flags.validated; }); const failed = vue.computed(() => { return flags.invalid && flags.validated; }); /** * Handles common onBlur meta update */ const onBlur = () => { flags.touched = true; flags.untouched = false; }; /** * Resets the flag state */ function reset() { const defaults = initialMeta(); Object.keys(flags).forEach((key) => { // Skip these, since they are computed anyways if (key === 'passed' || key === 'failed') { return; } flags[key] = defaults[key]; }); } return { meta: Object.assign(Object.assign({}, vue.toRefs(flags)), { passed, failed }), onBlur, reset, }; } function useAriAttrs(fieldName, meta) { return vue.computed(() => { return { 'aria-invalid': meta.failed.value ? 'true' : 'false', 'aria-describedBy': genFieldErrorId(unwrap(fieldName)), }; }); } /** * Extracts the validation rules from a schema */ function extractRuleFromSchema(schema, fieldName) { // no schema at all if (!schema) { return undefined; } // there is a key on the schema object for this field return schema[fieldName]; } const Field = vue.defineComponent({ name: 'Field', props: { as: { type: [String, Object], default: undefined, }, name: { type: String, required: true, }, rules: { type: [Object, String, Function], default: null, }, immediate: { type: Boolean, default: false, }, bails: { type: Boolean, default: () => getConfig().bails, }, disabled: { type: Boolean, default: false, }, }, setup(props, ctx) { const fieldName = props.name; // FIXME: is this right? const disabled = vue.computed(() => props.disabled); const rules = vue.computed(() => props.rules); const { errors, value, errorMessage, validate: validateField, handleChange, onBlur, reset, meta, aria } = useField(fieldName, rules, { immediate: props.immediate, bails: props.bails, disabled, }); const unwrappedMeta = useRefsObjToComputed(meta); const slotProps = vue.computed(() => { return { field: { name: fieldName, disabled: props.disabled, onInput: handleChange, onChange: handleChange, 'onUpdate:modelValue': handleChange, onBlur: onBlur, value: value.value, }, aria: aria.value, meta: unwrappedMeta.value, errors: errors.value, errorMessage: errorMessage.value, validate: validateField, reset, handleChange, }; }); return () => { const children = normalizeChildren(ctx, slotProps.value); if (props.as) { return vue.h(props.as, Object.assign(Object.assign(Object.assign({}, ctx.attrs), slotProps.value.field), (isHTMLTag(props.as) ? slotProps.value.aria : {})), children); } return children; }; }, }); function useForm(opts) { const fields = vue.ref([]); const isSubmitting = vue.ref(false); const fieldsById = vue.computed(() => { return fields.value.reduce((acc, field) => { acc[field.name] = field; return acc; }, {}); }); const activeFields = vue.computed(() => { return fields.value.filter(field => !unwrap(field.disabled)); }); const values = vue.computed(() => { return activeFields.value.reduce((acc, field) => { acc[field.name] = field.value; return acc; }, {}); }); const controller = { register(field) { var _a; const name = unwrap(field.name); // Set the initial value for that field if ((_a = opts === null || opts === void 0 ? void 0 : opts.initialValues) === null || _a === void 0 ? void 0 : _a[name]) { field.value.value = opts === null || opts === void 0 ? void 0 : opts.initialValues[name]; } fields.value.push(field); }, fields: fieldsById, values, schema: opts === null || opts === void 0 ? void 0 : opts.validationSchema, validateSchema: isYupValidator(opts === null || opts === void 0 ? void 0 : opts.validationSchema) ? (shouldMutate = false) => { return validateYupSchema(controller, shouldMutate); } : undefined, }; const validate = async () => { if (controller.validateSchema) { return controller.validateSchema(true).then(results => { return Object.keys(results).every(r => !results[r].errors.length); }); } const results = await Promise.all(activeFields.value.map((f) => { return f.validate(); })); return results.every(r => !r.errors.length); }; const errors = vue.computed(() => { return activeFields.value.reduce((acc, field) => { acc[field.name] = field.errorMessage; return acc; }, {}); }); const handleReset = () => { fields.value.forEach((f) => f.reset()); }; const handleSubmit = (fn) => { return function submissionHandler(e) { if (e instanceof Event) { e.preventDefault(); e.stopPropagation(); } isSubmitting.value = true; return validate() .then(result => { if (result && typeof fn === 'function') { return fn(values.value, e); } }) .then(() => { isSubmitting.value = false; }, err => { isSubmitting.value = false; // re-throw the err so it doesn't go silent throw err; }); }; }; const submitForm = handleSubmit((_, e) => { if (e) { e.target.submit(); } }); const meta = useFormMeta(fields); vue.provide('$_veeForm', controller); vue.provide('$_veeFormErrors', errors); return { errors, meta, form: controller, values, validate, isSubmitting, handleReset, handleSubmit, submitForm, }; } const MERGE_STRATEGIES = { valid: 'every', invalid: 'some', dirty: 'some', pristine: 'every', touched: 'some', untouched: 'every', pending: 'some', validated: 'every', changed: 'some', passed: 'every', failed: 'some', }; function useFormMeta(fields) { const flags = Object.keys(MERGE_STRATEGIES); return flags.reduce((acc, flag) => { acc[flag] = vue.computed(() => { const mergeMethod = MERGE_STRATEGIES[flag]; return fields.value[mergeMethod](field => field.meta[flag]); }); return acc; }, {}); } async function validateYupSchema(form, shouldMutate = false) { const errors = await form.schema .validate(form.values.value, { abortEarly: false }) .then(() => []) .catch((err) => { // Yup errors have a name prop one them. // https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string if (err.name !== 'ValidationError') { throw err; } // list of aggregated errors return err.inner || []; }); const fields = form.fields.value; const errorsByPath = errors.reduce((acc, err) => { acc[err.path] = err; return acc; }, {}); // Aggregates the validation result const aggregatedResult = Object.keys(fields).reduce((result, fieldId) => { const field = fields[fieldId]; const messages = (errorsByPath[fieldId] || { errors: [] }).errors; const fieldResult = { errors: messages, }; result[fieldId] = fieldResult; if (shouldMutate || field.meta.validated) { field.setValidationState(fieldResult); } return result; }, {}); return aggregatedResult; } const Form = vue.defineComponent({ name: 'Form', inheritAttrs: false, props: { as: { type: String, default: 'form', }, validationSchema: { type: Object, default: undefined, }, initialValues: { type: Object, default: undefined, }, }, setup(props, ctx) { const { errors, validate, handleSubmit, handleReset, values, meta, isSubmitting, submitForm } = useForm({ validationSchema: props.validationSchema, initialValues: props.initialValues, }); const unwrappedMeta = useRefsObjToComputed(meta); const slotProps = vue.computed(() => { return { meta: unwrappedMeta.value, errors: errors.value, values: values.value, isSubmitting: isSubmitting.value, validate, handleSubmit, handleReset, submitForm, }; }); const onSubmit = ctx.attrs.onSubmit ? handleSubmit(ctx.attrs.onSubmit) : submitForm; function handleFormReset() { handleReset(); if (typeof ctx.attrs.onReset === 'function') { ctx.attrs.onReset(); } } return () => { const children = normalizeChildren(ctx, slotProps.value); if (!props.as) { return children; } // Attributes to add on a native `form` tag const formAttrs = props.as === 'form' ? { // Disables native validation as vee-validate will handle it. novalidate: true, } : {}; return vue.h(props.as, Object.assign(Object.assign(Object.assign({}, formAttrs), ctx.attrs), { onSubmit, onReset: handleFormReset }), children); }; }, }); const ErrorMessage = vue.defineComponent({ props: { as: { type: String, default: undefined, }, name: { type: String, required: true, }, }, setup(props, ctx) { const errors = vue.inject('$_veeFormErrors', undefined); const message = vue.computed(() => { return errors.value[props.name]; }); return () => { const children = normalizeChildren(ctx, { message: message.value, }); const tag = props.as; const attrs = { id: genFieldErrorId(props.name), role: 'alert', }; // If no tag was specified and there are children // render the slot as is without wrapping it if (!tag && children.length) { return children; } // If no children in slot // render whatever specified and fallback to a <span> with the message in it's contents if (!children.length) { return vue.h(tag || 'span', attrs, message.value); } return vue.h(tag, Object.assign(Object.assign({}, attrs), ctx.attrs), children); }; }, }); exports.ErrorMessage = ErrorMessage; exports.Field = Field; exports.Form = Form; exports.configure = configure; exports.defineRule = defineRule; exports.useField = useField; exports.useForm = useForm; exports.validate = validate; Object.defineProperty(exports, '__esModule', { value: true }); })));
var request = require('supertest'); var app = require(__dirname+'/../../lib/app.js'); var gateway = require(__dirname+'/../../'); describe('clear withdrawals', function(){ it('should return unauthorized without credentials', function(done){ request(app) .post('/v1/withdrawals/110/clear') .expect(401) .end(function(err, res){ if (err) throw err; done(); }); }); it('should return successfully with credentials', function(done){ request(app) .post('/v1/withdrawals/110/clear') .auth('admin@'+gateway.config.get('DOMAIN'), gateway.config.get('KEY')) .expect(200) .end(function(err, res){ if (err) throw err; done(); }); }); });
var gulp = require('gulp'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var wrap = require('gulp-wrap'); var stripDebug = require('gulp-strip-debug'); var distFolder = './dist'; var files = [ './src/response.js', './src/request.js', './src/github.js', './src/repo-element.js' ]; var wrapper = [ '(function() {', '"use strict";', '<%= contents %>', '}.bind(typeof window !== "undefined" ? window : {})());' ].join('\n'); gulp.task('build', ['standalone', 'bundled']); gulp.task('standalone', function() { gulp.src(files) .pipe(stripDebug()) .pipe(concat('github-element.js')) .pipe(wrap(wrapper)) .pipe(uglify()) .pipe(gulp.dest(distFolder)); }); gulp.task('bundled', function() { gulp.src([ './bower_components/skatejs/dist/skate.js' ].concat(files)) .pipe(stripDebug()) .pipe(concat('github-element-bundled.js')) .pipe(wrap(wrapper)) .pipe(uglify()) .pipe(gulp.dest(distFolder)); });
var Signal = require('signals').Signal; var config = require('../config'); function CubeMapNodeBase(renderer, material, format, type) { type = type || config.textureType; this.renderer = renderer; var camera = new THREE.CubeCamera(0.1, 2, 256, type, format); var scene = new THREE.Scene(); var cubeGeomtry = new THREE.BoxGeometry(1, 1, 1, 1, 1, 1); var cube = new THREE.Mesh(cubeGeomtry, material); scene.add(cube); scene.add(camera); var texture = camera.renderTarget; this.camera = camera; this.scene = scene; this.material = material; this.texture = texture; this.updateSignal = new Signal(); this.update = this.update.bind(this); this.automaticUpdate = true; } CubeMapNodeBase.prototype.update = function(force) { if(!this.automaticUpdate && !force) return; this.camera.updateCubeMap(this.renderer, this.scene); this.updateSignal.dispatch(); } module.exports = CubeMapNodeBase;
export { WORKER_SCRIPT, WORKER_RENDER_PLATFORM, initializeGenericWorkerRenderer, WORKER_RENDER_APPLICATION_COMMON } from 'angular2/src/platform/worker_render_common'; export { WORKER_RENDER_APPLICATION, WebWorkerInstance } from 'angular2/src/platform/worker_render'; export { ClientMessageBroker, ClientMessageBrokerFactory, FnArg, UiArguments } from '../src/web_workers/shared/client_message_broker'; export { ReceivedMessage, ServiceMessageBroker, ServiceMessageBrokerFactory } from '../src/web_workers/shared/service_message_broker'; export { PRIMITIVE } from '../src/web_workers/shared/serializer'; export * from '../src/web_workers/shared/message_bus'; import { WORKER_RENDER_APPLICATION } from 'angular2/src/platform/worker_render'; /** * @deprecated Use WORKER_RENDER_APPLICATION */ export const WORKER_RENDER_APP = WORKER_RENDER_APPLICATION;
// Generated on 2014-01-03 using generator-webapp 0.4.6 'use strict'; // # Globbing // for performance reasons we're only matching one level down: // 'test/spec/{,*/}*.js' // use this if you want to recursively match all subfolders: // 'test/spec/**/*.js' module.exports = function (grunt) { // Load grunt tasks automatically require('load-grunt-tasks')(grunt); // Time how long tasks take. Can help when optimizing build times require('time-grunt')(grunt); var modRewrite = require('connect-modrewrite'); // Define the configuration for all the tasks grunt.initConfig({ // Project settings yeoman: { // Configurable paths app: 'app', dist: 'dist' }, // Watches files for changes and runs tasks based on the changed files watch: { jstest: { files: ['test/spec/{,*/}*.js'], tasks: ['test:watch'] }, gruntfile: { files: ['Gruntfile.js'] }, scripts: { files: ['<%= yeoman.app %>/scripts/**/*'], tasks: ['browserify'] }, sass: { files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'], tasks: ['sass:server', 'autoprefixer'] }, styles: { files: ['<%= yeoman.app %>/styles/{,*/}*.css'], tasks: ['newer:copy:styles', 'autoprefixer'] }, livereload: { options: { livereload: '<%= connect.options.livereload %>' }, files: [ '<%= yeoman.app %>/{,*/}*.html', '.tmp/scripts/main.js', '.tmp/styles/{,*/}*.css', '<%= yeoman.app %>/images/{,*/}*.{gif,jpeg,jpg,png,svg,webp}' ] }, packagejson: { files: ['package.json'], tasks: ['browserify'] } }, // The actual grunt server settings connect: { options: { port: 9000, livereload: 35729, // Change this to '0.0.0.0' to access the server from outside hostname: '0.0.0.0', middleware: function(connect, options, middlewares) { // Rewrite everything that does not contain a '.' to // support pushState middlewares.unshift(modRewrite(['^[^\\.]*$ /index.html [L]'])); return middlewares; } }, livereload: { options: { open: true, base: [ '.tmp', '<%= yeoman.app %>', '.', 'api/app' ] } }, test: { options: { port: 9001, base: [ '.tmp', 'test', '<%= yeoman.app %>', 'api/app' ] } }, dist: { options: { open: true, base: [ '<%= yeoman.dist %>', 'api/app' ], livereload: false } } }, // Empties folders to start fresh clean: { dist: { files: [{ dot: true, src: [ '.tmp', '<%= yeoman.dist %>/*', '!<%= yeoman.dist %>/.git*' ] }] }, server: '.tmp' }, // Make sure code styles are up to par and there are no obvious mistakes jshint: { options: { jshintrc: '.jshintrc', reporter: require('jshint-stylish') }, all: [ 'Gruntfile.js', '<%= yeoman.app %>/scripts/**/*.js', '!<%= yeoman.app %>/scripts/vendor/*', 'test/spec/{,*/}*.js' ] }, // Mocha testing framework configuration options mocha: { all: { options: { run: true, urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html'] } } }, // Compiles Sass to CSS and generates necessary files if requested sass: { options: { includePaths: ['<%= yeoman.app %>/bower_components'], sourcemap: true }, server: { options: { outputStyle: 'compressed' }, files: [{ expand: true, cwd: '<%= yeoman.app %>/styles', src: ['*.scss'], dest: '.tmp/styles', ext: '.css' }] } }, // Add vendor prefixed styles autoprefixer: { options: { // Commented out to use more extensive autoprefixer defaults // browsers: ['last 1 version'] }, dist: { files: [{ expand: true, cwd: '.tmp/styles/', src: '{,*/}*.css', dest: '.tmp/styles/' }] } }, browserify: { all: { files: { '.tmp/scripts/main.js': '<%= yeoman.app %>/scripts/main.js' }, options: { browserifyOptions: { debug: true }, watch: true } } }, // Renames files for browser caching purposes rev: { dist: { files: { src: [ '<%= yeoman.dist %>/scripts/{,*/}*.js', '<%= yeoman.dist %>/styles/{,*/}*.css', '!<%= yeoman.dist %>/styles/slate.min.css', '<%= yeoman.dist %>/images/{,*/}*.{gif,jpeg,jpg,png,webp}', // '<%= yeoman.dist %>/styles/fonts/{,*/}*.*' ] } } }, // Reads HTML for usemin blocks to enable smart builds that automatically // concat, minify and revision files. Creates configurations in memory so // additional tasks can operate on them useminPrepare: { options: { dest: '<%= yeoman.dist %>' }, html: '.tmp/index.html' }, // Performs rewrites based on rev and the useminPrepare configuration usemin: { options: { assetsDirs: ['<%= yeoman.dist %>'] }, html: ['<%= yeoman.dist %>/{,*/}*.html'], css: ['<%= yeoman.dist %>/styles/{,*/}*.css'] }, // The following *-min tasks produce minified files in the dist folder imagemin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.app %>/images', src: '{,*/}*.{gif,jpeg,jpg,png}', dest: '<%= yeoman.dist %>/images' }, { expand: true, cwd: '<%= yeoman.app %>/bower_components/select2', src: '*.{gif,png}', dest: '<%= yeoman.dist %>/styles' }] } }, svgmin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.app %>/images', src: '{,*/}*.svg', dest: '<%= yeoman.dist %>/images' }] } }, htmlmin: { dist: { options: { collapseBooleanAttributes: true, collapseWhitespace: true, removeAttributeQuotes: true, removeCommentsFromCDATA: true, removeEmptyAttributes: true, removeOptionalTags: true, removeRedundantAttributes: true, useShortDoctype: true }, files: [{ expand: true, cwd: '<%= yeoman.dist %>', src: '{,*/}*.html', dest: '<%= yeoman.dist %>' }] } }, // By default, your `index.html`'s <!-- Usemin block --> will take care of // minification. These next options are pre-configured if you do not wish // to use the Usemin blocks. cssmin: { dist: { files: { '<%= yeoman.dist %>/styles/exports.css': [ '.tmp/styles/exports.css' ] } } }, // uglify: { // dist: { // files: { // '<%= yeoman.dist %>/scripts/scripts.js': [ // '<%= yeoman.dist %>/scripts/scripts.js' // ] // } // } // }, // concat: { // dist: {} // }, // Copies remaining files to places other tasks can use copy: { dist: { files: [{ expand: true, dot: true, cwd: '<%= yeoman.app %>', dest: '<%= yeoman.dist %>', src: [ '*.{config,php}', '*.{ico,png,txt}', '.htaccess', 'images/{,*/}*.webp', '{,*/}*.html', 'scripts/disqus-count.js', 'config/*.json', 'styles/slate.min.css', 'styles/*.{gif,png}', 'styles/fonts/{,*/}*.*', 'vendor/knplabs/knp-snappy/src/**/*.php', 'vendor/facebook/php-sdk-v4/autoload.php', 'vendor/facebook/php-sdk-v4/src/Facebook/**/*', 'bower_components/font-awesome/fonts/*.*' ] }, { dest: '<%= yeoman.dist %>/ZeroClipboard.swf', src: 'node_modules/zeroclipboard/dist/ZeroClipboard.swf' }, { expand: true, cwd: '.tmp', dest: '<%= yeoman.dist %>', src: 'index.html' }] }, styles: { expand: true, dot: true, cwd: '<%= yeoman.app %>/styles', dest: '.tmp/styles/', src: '{,*/}*.css' }, tmp: { expand: true, cwd: '<%= yeoman.app %>', dest: '.tmp', src: [ 'bower_components/qtip2/jquery.qtip.css', 'bower_components/select2/select2.css', 'bower_components/animate.css/animate.min.css', 'index.html' ] } }, // Run some tasks in parallel to speed up build process concurrent: { server: [ 'sass:server', 'copy:styles' ], test: [ 'copy:styles' ], dist: [ 'sass', 'copy:styles', 'imagemin', 'svgmin' ] }, rsync: { options: { args: ['-cruv'] }, 'nusmods.com': { options: { src: '<%= yeoman.dist %>/*', dest: '~/nusmods.com' } } } }); grunt.registerTask('serve', function (target) { if (target === 'dist') { return grunt.task.run(['build', 'connect:dist:keepalive']); } grunt.task.run([ 'clean:server', 'concurrent:server', 'autoprefixer', 'browserify', 'connect:livereload', 'watch' ]); }); grunt.registerTask('server', function () { grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.'); grunt.task.run(['serve']); }); grunt.registerTask('test', function(target) { if (target !== 'watch') { grunt.task.run([ 'clean:server', 'concurrent:test', 'autoprefixer' ]); } grunt.task.run([ 'connect:test', 'mocha' ]); }); grunt.registerTask('build', [ 'clean:dist', 'copy:tmp', 'useminPrepare', 'concurrent:dist', 'autoprefixer', 'browserify', 'concat', 'cssmin', 'uglify', 'copy:dist', 'rev', 'usemin', 'htmlmin' ]); grunt.registerTask('default', [ 'newer:jshint', // 'test', 'build' ]); };
"use strict"; var TechnicalDrawingsView = Backbone.View.extend({ initialize: function() { _.bindAll(this, "render"); var self = this; self.render(); }, template: JST['ooiui/static/js/partials/TechnicalDrawings.html'], render: function() { this.$el.html(this.template()); }  });
var delay = true; function resetDelay(ms) { setTimeout(function() { delay = true; }, ms); } /* If you don't want an image on the button set the img param to false or null. Use ms for buttonDelay param. This function prevents the user to click the button multiple times on a second, the function creates a delay between the clicks. The default value is 250 ms. Only use functions for the action param. */ function Button(x, y, w, h, img, col, hoverCol, buttonDelay, action) { this.x = x; this.y = y; this.w = w; this.h = h; this.img = img; this.col = col; this.hoverCol = hoverCol; this.buttonDelay = buttonDelay; this.action = action; this.show = function() { push(); fill(this.col); if(this.hover()) { fill(this.hoverCol); } if(this.img != false && this.img != null) { image(img, this.x, this.y); } rect(this.x, this.y, this.w, this.h); pop(); } this.hover = function() { let sideL = this.x; let sideR = this.x + this.w; let sideU = this.y; let sideD = this.y + this.h; if(mouseX > sideL && mouseX < sideR && mouseY > sideU && mouseY < sideD) { if(mouseIsPressed && delay) { delay = false; this.action(); resetDelay(this.buttonDelay); } return true; } else { return false; } } }
// Copyright (c) 2012,2013 Peter Coles - http://mrcoles.com/ - All rights reserved. // Use of this source code is governed by the MIT License found in LICENSE // // console object for debugging // var log = (function() { var parElt = document.getElementById('wrap'), logElt = document.createElement('div'); logElt.id = 'log'; logElt.style.display = 'block'; parElt.appendChild(logElt); return function() { var a, p, results = []; for (var i=0, len=arguments.length; i<len; i++) { a = arguments[i]; try { a = JSON.stringify(a, null, 2); } catch(e) {} results.push(a); } p = document.createElement('p'); p.innerText = results.join(' '); p.innerHTML = p.innerHTML.replace(/ /g, '&nbsp;'); logElt.appendChild(p); }; })(); // // utility methods // function $(id) { return document.getElementById(id); } function show(id) { $(id).style.display = 'block'; } function hide(id) { $(id).style.display = 'none'; } // // URL Matching test - to verify we can talk to this URL // var matches = ['http://*/*', 'https://*/*', 'ftp://*/*', 'file://*/*'], noMatches = [/^https?:\/\/chrome.google.com\/.*$/]; function testURLMatches(url) { // couldn't find a better way to tell if executeScript // wouldn't work -- so just testing against known urls // for now... var r, i; for (i=noMatches.length-1; i>=0; i--) { if (noMatches[i].test(url)) { return false; } } for (i=matches.length-1; i>=0; i--) { r = new RegExp('^' + matches[i].replace(/\*/g, '.*') + '$'); if (r.test(url)) { return true; } } return false; } // // Events // var screenshot, contentURL = ''; function sendScrollMessage(tab) { contentURL = tab.url; screenshot = {}; chrome.tabs.sendRequest(tab.id, {msg: 'scrollPage'}, function() { // We're done taking snapshots of all parts of the window. Display // the resulting full screenshot image in a new browser tab. openPage(); }); } function sendLogMessage(data) { chrome.tabs.getSelected(null, function(tab) { chrome.tabs.sendRequest(tab.id, {msg: 'logMessage', data: data}, function() {}); }); } chrome.extension.onRequest.addListener(function(request, sender, callback) { if (request.msg === 'capturePage') { capturePage(request, sender, callback); } else { console.error('Unknown message received from content script: ' + request.msg); } }); function capturePage(data, sender, callback) { var canvas; $('bar').style.width = parseInt(data.complete * 100, 10) + '%'; // Get window.devicePixelRatio from the page, not the popup var scale = data.devicePixelRatio && data.devicePixelRatio !== 1 ? 1 / data.devicePixelRatio : 1; // if the canvas is scaled, then x- and y-positions have to make // up for it if (scale !== 1) { data.x = data.x / scale; data.y = data.y / scale; data.totalWidth = data.totalWidth / scale; data.totalHeight = data.totalHeight / scale; } if (!screenshot.canvas) { canvas = document.createElement('canvas'); canvas.width = data.totalWidth; canvas.height = data.totalHeight; screenshot.canvas = canvas; screenshot.ctx = canvas.getContext('2d'); // sendLogMessage('TOTALDIMENSIONS: ' + data.totalWidth + ', ' + data.totalHeight); // // Scale to account for device pixel ratios greater than one. (On a // // MacBook Pro with Retina display, window.devicePixelRatio = 2.) // if (scale !== 1) { // // TODO - create option to not scale? It's not clear if it's // // better to scale down the image or to just draw it twice // // as large. // screenshot.ctx.scale(scale, scale); // } } // sendLogMessage(data); chrome.tabs.captureVisibleTab( null, {format: 'png', quality: 100}, function(dataURI) { if (dataURI) { var image = new Image(); image.onload = function() { // sendLogMessage('img dims: ' + image.width + ', ' + image.height); screenshot.ctx.drawImage(image, data.x, data.y); callback(true); }; image.src = dataURI; } }); } function openPage() { // standard dataURI can be too big, let's blob instead // http://code.google.com/p/chromium/issues/detail?id=69227#c27 var dataURI = screenshot.canvas.toDataURL(); // convert base64 to raw binary data held in a string // doesn't handle URLEncoded DataURIs var byteString = atob(dataURI.split(',')[1]); // separate out the mime component var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; // write the bytes of the string to an ArrayBuffer var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } // create a blob for writing to a file var blob = new Blob([ab], {type: mimeString}); // come up with file-system size with a little buffer var size = blob.size + (1024/2); // come up with a filename var name = contentURL.split('?')[0].split('#')[0]; if (name) { name = name .replace(/^https?:\/\//, '') .replace(/[^A-z0-9]+/g, '-') .replace(/-+/g, '-') .replace(/^[_\-]+/, '') .replace(/[_\-]+$/, ''); name = '-' + name; } else { name = ''; } name = 'screencapture' + name + '-' + Date.now() + '.png'; function onwriteend() { // open the file that now contains the blob window.open('filesystem:chrome-extension://' + chrome.i18n.getMessage('@@extension_id') + '/temporary/' + name); } function errorHandler() { show('uh-oh'); } // create a blob for writing to a file window.webkitRequestFileSystem(window.TEMPORARY, size, function(fs){ fs.root.getFile(name, {create: true}, function(fileEntry) { fileEntry.createWriter(function(fileWriter) { fileWriter.onwriteend = onwriteend; fileWriter.write(blob); }, errorHandler); }, errorHandler); }, errorHandler); } // // start doing stuff immediately! - including error cases // chrome.tabs.getSelected(null, function(tab) { if (testURLMatches(tab.url)) { var loaded = false; chrome.tabs.executeScript(tab.id, {file: 'page.js'}, function() { loaded = true; show('loading'); sendScrollMessage(tab); }); window.setTimeout(function() { if (!loaded) { show('uh-oh'); } }, 1000); } else { show('invalid'); } });
const express = require('express'); const staticServer = express(); staticServer.use(express.static('.')); staticServer.listen(3000, function() { console.log('Listening on 3000'); });
// Copyright (c) 2012 Ecma International. All rights reserved. // Ecma International makes this code available under the terms and conditions set // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the // "Use Terms"). Any redistribution of this code must retain the above // copyright and this notice and otherwise comply with the Use Terms. /*--- es5id: 12.10-0-11 description: with introduces scope - name lookup finds inner variable includes: [runTestCase.js] ---*/ function testcase() { function f(o) { function innerf(o) { var x = 42; with (o) { return x; } } return innerf(o); } if (f({}) === 42) { return true; } } runTestCase(testcase);
var path = require('path'), glob = require('glob'), log = require('./logger'), helper = require('./util'); // Coffee is required here to enable config files written in coffee-script. try { require('coffee-script').register(); } catch (e) { // Intentionally blank - ignore if coffee-script is not available. } // LiveScript is required here to enable config files written in LiveScript. try { require('LiveScript'); } catch (e) { // Intentionally blank - ignore if LiveScript is not available. } var ConfigParser = function() { // Default configuration. this.config_ = { specs: [], multiCapabilities: [], rootElement: 'body', allScriptsTimeout: 11000, getPageTimeout: 10000, params: {}, framework: 'jasmine', jasmineNodeOpts: { showColors: true, stackFilter: helper.filterStackTrace, defaultTimeoutInterval: (30 * 1000) }, seleniumArgs: [], mochaOpts: { ui: 'bdd', reporter: 'list' }, chromeDriver: null, configDir: './', plugins: [], skipSourceMapSupport: false }; }; /** * Merge config objects together. * * @private * @param {Object} into * @param {Object} from * * @return {Object} The 'into' config. */ var merge_ = function(into, from) { for (var key in from) { if (into[key] instanceof Object && !(into[key] instanceof Array) && !(into[key] instanceof Function)) { merge_(into[key], from[key]); } else { into[key] = from[key]; } } return into; }; /** * Returns the item if it's an array or puts the item in an array * if it was not one already. */ var makeArray = function(item) { return Array.isArray(item) ? item : [item]; }; /** * Adds to an array all the elements in another array without adding any * duplicates * * @param {Array<string>} dest The array to add to * @param {Array<string>} src The array to copy from */ var union = function(dest, src) { var elems = {}; for (var key in dest) { elems[dest[key]] = true; } for (key in src) { if (!elems[src[key]]) { dest.push(src[key]); elems[src[key]] = true; } } }; /** * Resolve a list of file patterns into a list of individual file paths. * * @param {Array.<string> | string} patterns * @param {=boolean} opt_omitWarnings Whether to omit did not match warnings * @param {=string} opt_relativeTo Path to resolve patterns against * * @return {Array} The resolved file paths. */ ConfigParser.resolveFilePatterns = function(patterns, opt_omitWarnings, opt_relativeTo) { var resolvedFiles = []; var cwd = opt_relativeTo || process.cwd(); patterns = (typeof patterns === 'string') ? [patterns] : patterns; if (patterns) { for (var i = 0; i < patterns.length; ++i) { var fileName = patterns[i]; var matches = glob.sync(fileName, {cwd: cwd}); if (!matches.length && !opt_omitWarnings) { log.warn('pattern ' + patterns[i] + ' did not match any files.'); } for (var j = 0; j < matches.length; ++j) { var resolvedPath = path.resolve(cwd, matches[j]); resolvedFiles.push(resolvedPath); } } } return resolvedFiles; }; /** * Returns only the specs that should run currently based on `config.suite` * * @return {Array} An array of globs locating the spec files */ ConfigParser.getSpecs = function(config) { var specs = []; if (config.suite) { config.suite.split(',').forEach(function(suite) { var suiteList = config.suites[suite]; if (suiteList == null) { throw new Error('Unknown test suite: ' + suite); } union(specs, makeArray(suiteList)); }); return specs; } if (config.specs.length > 0) { return config.specs; } Array.prototype.forEach.call(config.suites, function(suite) { union(specs, makeArray(suite)); }); return specs; }; /** * Add the options in the parameter config to this runner instance. * * @private * @param {Object} additionalConfig * @param {string} relativeTo the file path to resolve paths against */ ConfigParser.prototype.addConfig_ = function(additionalConfig, relativeTo) { // All filepaths should be kept relative to the current config location. // This will not affect absolute paths. ['seleniumServerJar', 'chromeDriver', 'onPrepare', 'firefoxPath', 'frameworkPath']. forEach(function(name) { if (additionalConfig[name] && typeof additionalConfig[name] === 'string') { additionalConfig[name] = path.resolve(relativeTo, additionalConfig[name]); } }); merge_(this.config_, additionalConfig); }; /** * Public function specialized towards merging in a file's config * * @public * @param {String} filename */ ConfigParser.prototype.addFileConfig = function(filename) { try { if (!filename) { return this; } var filePath = path.resolve(process.cwd(), filename); var fileConfig = require(filePath).config; if (!fileConfig) { log.error('configuration file ' + filename + ' did not export a config ' + 'object'); } fileConfig.configDir = path.dirname(filePath); this.addConfig_(fileConfig, fileConfig.configDir); } catch (e) { log.error('failed loading configuration file ' + filename); throw e; } return this; }; /** * Public function specialized towards merging in config from argv * * @public * @param {Object} argv */ ConfigParser.prototype.addConfig = function(argv) { this.addConfig_(argv, process.cwd()); return this; }; /** * Public getter for the final, computed config object * * @public * @return {Object} config */ ConfigParser.prototype.getConfig = function() { return this.config_; }; module.exports = ConfigParser;
import * as LogManager from 'aurelia-logging'; import {Origin} from 'aurelia-metadata'; import {Loader, TemplateRegistryEntry} from 'aurelia-loader'; import {Container, inject} from 'aurelia-dependency-injection'; import {ViewCompiler} from './view-compiler'; import {ViewResources} from './view-resources'; import {ModuleAnalyzer, ResourceDescription} from './module-analyzer'; import {ViewFactory} from './view-factory'; import {ResourceLoadContext, ViewCompileInstruction} from './instructions'; import {SlotCustomAttribute} from './shadow-dom'; import {HtmlBehaviorResource} from './html-behavior'; let logger = LogManager.getLogger('templating'); function ensureRegistryEntry(loader, urlOrRegistryEntry) { if (urlOrRegistryEntry instanceof TemplateRegistryEntry) { return Promise.resolve(urlOrRegistryEntry); } return loader.loadTemplate(urlOrRegistryEntry); } class ProxyViewFactory { constructor(promise) { promise.then(x => this.viewFactory = x); } create(container: Container, bindingContext?: Object, createInstruction?: ViewCreateInstruction, element?: Element): View { return this.viewFactory.create(container, bindingContext, createInstruction, element); } get isCaching() { return this.viewFactory.isCaching; } setCacheSize(size: number | string, doNotOverrideIfAlreadySet: boolean): void { this.viewFactory.setCacheSize(size, doNotOverrideIfAlreadySet); } getCachedView(): View { return this.viewFactory.getCachedView(); } returnViewToCache(view: View): void { this.viewFactory.returnViewToCache(view); } } /** * Controls the view resource loading pipeline. */ @inject(Loader, Container, ViewCompiler, ModuleAnalyzer, ViewResources) export class ViewEngine { /** * Creates an instance of ViewEngine. * @param loader The module loader. * @param container The root DI container for the app. * @param viewCompiler The view compiler. * @param moduleAnalyzer The module analyzer. * @param appResources The app-level global resources. */ constructor(loader: Loader, container: Container, viewCompiler: ViewCompiler, moduleAnalyzer: ModuleAnalyzer, appResources: ViewResources) { this.loader = loader; this.container = container; this.viewCompiler = viewCompiler; this.moduleAnalyzer = moduleAnalyzer; this.appResources = appResources; this._pluginMap = {}; let auSlotBehavior = new HtmlBehaviorResource(); auSlotBehavior.attributeName = 'au-slot'; auSlotBehavior.initialize(container, SlotCustomAttribute); auSlotBehavior.register(appResources); } /** * Adds a resource plugin to the resource loading pipeline. * @param extension The file extension to match in require elements. * @param implementation The plugin implementation that handles the resource type. */ addResourcePlugin(extension: string, implementation: Object): void { let name = extension.replace('.', '') + '-resource-plugin'; this._pluginMap[extension] = name; this.loader.addPlugin(name, implementation); } /** * Loads and compiles a ViewFactory from a url or template registry entry. * @param urlOrRegistryEntry A url or template registry entry to generate the view factory for. * @param compileInstruction Instructions detailing how the factory should be compiled. * @param loadContext The load context if this factory load is happening within the context of a larger load operation. * @return A promise for the compiled view factory. */ loadViewFactory(urlOrRegistryEntry: string|TemplateRegistryEntry, compileInstruction?: ViewCompileInstruction, loadContext?: ResourceLoadContext): Promise<ViewFactory> { loadContext = loadContext || new ResourceLoadContext(); return ensureRegistryEntry(this.loader, urlOrRegistryEntry).then(registryEntry => { if (registryEntry.onReady) { if (!loadContext.hasDependency(urlOrRegistryEntry)) { loadContext.addDependency(urlOrRegistryEntry); return registryEntry.onReady; } return Promise.resolve(new ProxyViewFactory(registryEntry.onReady)); } loadContext.addDependency(urlOrRegistryEntry); registryEntry.onReady = this.loadTemplateResources(registryEntry, compileInstruction, loadContext).then(resources => { registryEntry.resources = resources; let viewFactory = this.viewCompiler.compile(registryEntry.template, resources, compileInstruction); registryEntry.factory = viewFactory; return viewFactory; }); return registryEntry.onReady; }); } /** * Loads all the resources specified by the registry entry. * @param registryEntry The template registry entry to load the resources for. * @param compileInstruction The compile instruction associated with the load. * @param loadContext The load context if this is happening within the context of a larger load operation. * @return A promise of ViewResources for the registry entry. */ loadTemplateResources(registryEntry: TemplateRegistryEntry, compileInstruction?: ViewCompileInstruction, loadContext?: ResourceLoadContext): Promise<ViewResources> { let resources = new ViewResources(this.appResources, registryEntry.address); let dependencies = registryEntry.dependencies; let importIds; let names; compileInstruction = compileInstruction || ViewCompileInstruction.normal; if (dependencies.length === 0 && !compileInstruction.associatedModuleId) { return Promise.resolve(resources); } importIds = dependencies.map(x => x.src); names = dependencies.map(x => x.name); logger.debug(`importing resources for ${registryEntry.address}`, importIds); return this.importViewResources(importIds, names, resources, compileInstruction, loadContext); } /** * Loads a view model as a resource. * @param moduleImport The module to import. * @param moduleMember The export from the module to generate the resource for. * @return A promise for the ResourceDescription. */ importViewModelResource(moduleImport: string, moduleMember: string): Promise<ResourceDescription> { return this.loader.loadModule(moduleImport).then(viewModelModule => { let normalizedId = Origin.get(viewModelModule).moduleId; let resourceModule = this.moduleAnalyzer.analyze(normalizedId, viewModelModule, moduleMember); if (!resourceModule.mainResource) { throw new Error(`No view model found in module "${moduleImport}".`); } resourceModule.initialize(this.container); return resourceModule.mainResource; }); } /** * Imports the specified resources with the specified names into the view resources object. * @param moduleIds The modules to load. * @param names The names associated with resource modules to import. * @param resources The resources lookup to add the loaded resources to. * @param compileInstruction The compilation instruction associated with the resource imports. * @return A promise for the ViewResources. */ importViewResources(moduleIds: string[], names: string[], resources: ViewResources, compileInstruction?: ViewCompileInstruction, loadContext?: ResourceLoadContext): Promise<ViewResources> { loadContext = loadContext || new ResourceLoadContext(); compileInstruction = compileInstruction || ViewCompileInstruction.normal; moduleIds = moduleIds.map(x => this._applyLoaderPlugin(x)); return this.loader.loadAllModules(moduleIds).then(imports => { let i; let ii; let analysis; let normalizedId; let current; let associatedModule; let container = this.container; let moduleAnalyzer = this.moduleAnalyzer; let allAnalysis = new Array(imports.length); //initialize and register all resources first //this enables circular references for global refs //and enables order independence for (i = 0, ii = imports.length; i < ii; ++i) { current = imports[i]; normalizedId = Origin.get(current).moduleId; analysis = moduleAnalyzer.analyze(normalizedId, current); analysis.initialize(container); analysis.register(resources, names[i]); allAnalysis[i] = analysis; } if (compileInstruction.associatedModuleId) { associatedModule = moduleAnalyzer.getAnalysis(compileInstruction.associatedModuleId); if (associatedModule) { associatedModule.register(resources); } } //cause compile/load of any associated views second //as a result all globals have access to all other globals during compilation for (i = 0, ii = allAnalysis.length; i < ii; ++i) { allAnalysis[i] = allAnalysis[i].load(container, loadContext); } return Promise.all(allAnalysis).then(() => resources); }); } _applyLoaderPlugin(id) { let index = id.lastIndexOf('.'); if (index !== -1) { let ext = id.substring(index); let pluginName = this._pluginMap[ext]; if (pluginName === undefined) { return id; } return this.loader.applyPluginToUrl(id, pluginName); } return id; } }
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon")); var _jsxRuntime = require("react/jsx-runtime"); var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", { d: "m14.43 10-1.47-4.84c-.29-.95-1.63-.95-1.91 0L9.57 10H5.12c-.97 0-1.37 1.25-.58 1.81l3.64 2.6-1.43 4.61c-.29.93.79 1.68 1.56 1.09l3.69-2.8 3.69 2.81c.77.59 1.85-.16 1.56-1.09l-1.43-4.61 3.64-2.6c.79-.57.39-1.81-.58-1.81h-4.45z" }), 'StarRateRounded'); exports.default = _default;
"use strict"; define(['RSVP', 'jQuery', 'Ember'], function (RSVP, $, Ember) { var DEVICE_INFO = {"vendorId": 0x0483, "productId": 0xFFFF}; function emberizePromisize(usbFunction, firstArgs) { return new RSVP.Promise(function (resolve, reject) { function callback() { if (chrome.runtime.lastError) reject(chrome.runtime.lastError, arguments, arguments[0].resultCode); else resolve.apply(null, arguments); } usbFunction.apply(null, firstArgs.concat([Ember.run.bind(null, callback)])); }); } // the chrome API is copied here for aesthetic reasons. It gives us a complete prototype function claimInterface(handle, interfaceNumber) { return emberizePromisize(chrome.usb.claimInterface, [handle, interfaceNumber]); } function releaseInterface(handle, interfaceNumber) { return emberizePromisize(chrome.usb.releaseInterface, [handle, interfaceNumber]); } function resetDevice(handle) { return emberizePromisize(chrome.usb.resetDevice, [handle]) } function closeDevice(handle) { return emberizePromisize(chrome.usb.closeDevice, [handle]) } function findDevices(options) { return emberizePromisize(chrome.usb.findDevices, [options]); } /* Just an object holding a USB connection to the device, and exposing a low-level communication API. */ return Ember.Object.extend({ currentDevice: null, usbObservers: {}, DEVICE_INFO: DEVICE_INFO, DEFAULT_TRANSFER_INFO: { requestType: 'vendor', recipient: 'interface', direction: 'in', value: 0, index: 0, data: new ArrayBuffer(0) }, claim: function (device) { return claimInterface(device, 0).then(function () { return device; }); }, bind: function () { var _this = this; return _this.find() .then(function (device) { return _this.claim(device); }) .then(function (device) { _this.set('currentDevice', device); return device; }) }, find: function () { var _this = this; return findDevices(_this.DEVICE_INFO).then(function (devices) { if (!devices.length) { _this.set('currentDevice', null); throw null; } else return devices[0]; }); }, promisedTransfer: function (usbFunction, transferInfo) { return emberizePromisize(usbFunction, [this.get('currentDevice'), transferInfo]) .then(function (usbEvent) { var errorCode = usbEvent.resultCode; if (errorCode) { var error = chrome.runtime.lastError; console.error(errorCode, error); throw errorCode; } return usbEvent.data; }); }, reset: function () { var _this = this; if (_this.get('currentDevice') != null) return resetDevice(_this.get('currentDevice')) .finally(function () { _this.set('currentDevice', null); }); return null; }, close: function () { var _this = this; return closeDevice(this.get('currentDevice')) .finally(function () { _this.set('currentDevice', null); }); }, release: function () { return releaseInterface(this.get('currentDevice'), 0); }, createTransferPacket: function (transferInfo) { return $.extend({}, this.DEFAULT_TRANSFER_INFO, transferInfo); }, controlTransfer: function (partialTransferInfo) { return this.promisedTransfer(chrome.usb.controlTransfer, this.createTransferPacket(partialTransferInfo)); }, bulkTransfer: function (transfer) { return this.promisedTransfer(chrome.usb.bulkTransfer, transfer); }, interruptTransfer: function (transfer) { return this.promisedTransfer(chrome.usb.interruptTransfer, transfer); }, opened: function () { return this.get('currentDevice') != null; }.property('currentDevice') }); });
/* WizUniqueIdentifier for PhoneGap - * * @author Ally Ogilvie * @copyright Wizcorp Inc. [ Incorporated Wizards ] 2014 * @file - wizUniqueIdentifier.js * @about - JavaScript PhoneGap bridge for unique identifer * * */ var wizUniqueIdentifier = { // get -- retrieve a unique identifier for a given key (the same identifier // will always be returned until the device content and settings is reset) get: function(successCallback) { return cordova.exec(successCallback, null, "WizUniqueIdentifier", "get", []); } };
/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ 'use strict'; const Relay = require('../RelayPublic'); const performanceNow = require('performanceNow'); const xhrSimpleDataSerializer = require('xhrSimpleDataSerializer'); import type RelayMutationRequest from '../network/RelayMutationRequest'; import type RelayQueryRequest from '../network/RelayQueryRequest'; import type RelayEnvironment from '../store/RelayEnvironment'; import type {ChangeSubscription} from './RelayTypes'; export type RelayNetworkDebuggable = { name: string, type: string, promise: Promise<any>, logResult: (error: ?Object, response: ?Object) => void, }; class RelayNetworkDebugger { _initTime: number; _queryID: number; _subscription: ChangeSubscription; constructor( environment: RelayEnvironment, graphiqlPrinter: ?( request: RelayQueryRequest | RelayMutationRequest, ) => string, ) { this._initTime = performanceNow(); this._queryID = 0; this._subscription = environment.addNetworkSubscriber( request => this.logRequest( createDebuggableFromRequest('Relay Query', request, graphiqlPrinter), ), request => this.logRequest( createDebuggableFromRequest( 'Relay Mutation', request, graphiqlPrinter, ), ), ); } uninstall(): void { this._subscription.remove(); } logRequest({name, type, promise, logResult}: RelayNetworkDebuggable): void { const id = this._queryID++; const timerName = `[${id}] Request Duration`; console.timeStamp && console.timeStamp(`START: [${id}] ${type}: ${name} \u2192`); console.time && console.time(timerName); const onSettled = (error, response) => { const time = (performanceNow() - this._initTime) / 1000; console.timeStamp && console.timeStamp(`\u2190 END: [${id}] ${type}: ${name}`); const groupName = `%c[${id}] ${type}: ${name} @ ${time}s`; console.groupCollapsed(groupName, `color:${error ? 'red' : 'black'};`); console.timeEnd && console.timeEnd(timerName); logResult(error, response); console.groupEnd(); }; promise.then( response => onSettled(null, response), error => onSettled(error, null), ); } } function createDebuggableFromRequest( type: string, request: RelayQueryRequest | RelayMutationRequest, graphiqlPrinter: ?( request: RelayQueryRequest | RelayMutationRequest, ) => string, ): RelayNetworkDebuggable { return { name: request.getDebugName(), type, promise: request.getPromise(), logResult(error, response) { const requestSize = formatSize( xhrSimpleDataSerializer({ q: request.getQueryString(), query_params: request.getVariables(), }).length, ); const requestVariables = request.getVariables(); console.groupCollapsed('Request Query (Estimated Size: %s)', requestSize); if (graphiqlPrinter) { console.groupCollapsed('GraphiQL Link'); console.debug(graphiqlPrinter(request)); console.groupEnd(); } console.groupCollapsed('Query Text'); console.debug( '%c%s\n', 'font-size:10px; color:#333; font-family:mplus-2m-regular,menlo,' + 'monospaced;', request.getQueryString(), ); console.groupEnd(); console.groupEnd(); if (Object.keys(requestVariables).length > 0) { // eslint-disable-next-line no-console console.log('Request Variables\n', request.getVariables()); } error && console.error(error); // eslint-disable-next-line no-console response && console.log(response); }, }; } const ALL_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; function formatSize(bytes: number): string { const sign = bytes < 0 ? -1 : 1; bytes = Math.abs(bytes); let i = 0; while (bytes >= Math.pow(1024, i + 1) && i < ALL_UNITS.length) { i++; } const value = sign * bytes * 1.0 / Math.pow(1024, i); return Number(value.toFixed(2)) + ALL_UNITS[i]; } let networkDebugger: ?RelayNetworkDebugger; const RelayNetworkDebug = { init( environment: RelayEnvironment = Relay.Store, graphiqlPrinter: ?( request: RelayQueryRequest | RelayMutationRequest, ) => string, ): void { networkDebugger && networkDebugger.uninstall(); // Without `groupCollapsed`, RelayNetworkDebug is too noisy. if (console.groupCollapsed) { networkDebugger = new RelayNetworkDebugger(environment, graphiqlPrinter); } }, logRequest(request: RelayNetworkDebuggable): void { networkDebugger && networkDebugger.logRequest(request); }, }; module.exports = RelayNetworkDebug;
var module = ['module.js']; var boot; module.boot = function(gems) { var InitModules = gems.InitModules; InitModules(); };
import helper from 'yeoman-test'; import assert from 'yeoman-assert'; import path from 'path'; import fs from 'fs-extra'; import { getFileContent, getFixturePath, } from '../../../test/helpers'; import { getConfigDir } from '../../utils'; const connectionGenerator = path.join(__dirname, '..'); it('generate a connection', async () => { const folder = await helper.run(connectionGenerator) .withArguments('Example') .toPromise(); const destinationDir = getConfigDir('connection'); assert.file([ `${destinationDir}/ExampleConnection.js`, ]); const files = { connection: getFileContent(`${folder}/${destinationDir}/ExampleConnection.js`), }; expect(files).toMatchSnapshot(); }); it('generate a connection with schema', async () => { const folder = await helper.run(connectionGenerator) .inTmpDir(dir => fs.copySync( getFixturePath('Post'), path.join(dir, 'src/model/Post.js'), ), ) .withArguments('Post Post') .toPromise(); const destinationDir = getConfigDir('connection'); assert.file([ `${destinationDir}/PostConnection.js`, ]); const files = { connection: getFileContent(`${folder}/${destinationDir}/PostConnection.js`), }; expect(files).toMatchSnapshot(); }); it('should always import connectionDefinitions', async () => { await helper.run(connectionGenerator) .withArguments('Example') .toPromise(); const destinationDir = getConfigDir('connection'); const connectionFile = `${destinationDir}/ExampleConnection.js`; assert.fileContent( connectionFile, 'import { connectionDefinitions } from \'graphql-relay\';', ); });
'use strict'; // Create the chat configuration module.exports = function (io, socket) { // Emit the status event when a new socket client is connected io.emit('chatMessage', { type: 'status', text: 'Is now connected', created: Date.now(), profileImageURL: socket.request.user.profileImageURL, username: socket.request.user.username }); // Send a chat messages to all connected sockets when a message is received socket.on('chatMessage', function (message) { message.type = 'message'; message.created = Date.now(); message.profileImageURL = socket.request.user.profileImageURL; message.username = socket.request.user.username; // Emit the 'chatMessage' event io.emit('chatMessage', message); }); // Emit the status event when a socket client is disconnected socket.on('disconnect', function () { io.emit('chatMessage', { type: 'status', text: 'disconnected', created: Date.now(), username: socket.request.user.username }); }); };
goog.provide('ash.fsm.ComponentSingletonProvider'); /** * @constructor * @param {Function} type The type of the single instance */ ash.fsm.ComponentSingletonProvider = function(type) { this.componentType = type; } /** * @type {Function} */ ash.fsm.ComponentSingletonProvider.prototype.componentType = null; /** * @type {Object} */ ash.fsm.ComponentSingletonProvider.prototype.instance = null; /** * Used to request a component from this provider * * @return {Object} The instance */ ash.fsm.ComponentSingletonProvider.prototype.getComponent = function() { if (this.instance == null) { this.instance = new this.componentType(); } return this.instance; }; /** * Used to compare this provider with others. Any provider that returns the same component * instance will be regarded as equivalent. * * @return {Object} The instance */ ash.fsm.ComponentSingletonProvider.prototype.getIdentifier = function() { return this.getComponent(); };
'use strict'; angular.module('flickr-client') .controller('PhotoCubeCtrl', function ($scope, $famous, flickr) { var Transitionable = $famous['famous/transitions/Transitionable']; var Easing = $famous['famous/transitions/Easing']; var Timer = $famous['famous/utilities/Timer']; var EventHandler = $famous['famous/core/EventHandler']; var GenericSync = $famous['famous/inputs/GenericSync']; var MouseSync = $famous["famous/inputs/MouseSync"]; var TouchSync = $famous["famous/inputs/TouchSync"]; var ScrollSync = $famous["famous/inputs/ScrollSync"]; var CUBE_SCROLL_SPEED = .005; var DOUBLE_TAP_THRESHOLD = 300; GenericSync.register({ "mouse" : MouseSync, "touch" : TouchSync, "scroll": ScrollSync }); var TRANSITIONS = { SCALE: { duration: 333, curve: Easing.outQuint }, ROTATE: { duration: 500, curve: Easing.outBounce } } $scope.faces = [ {type: "photo"}, {type: "photo"}, {type: "title"}, {type: "photo"}, {type: "title"}, {type: "photo"}, ]; $scope.handleDoubleTap = function(){ }; var cubeSync = new GenericSync(["mouse", "touch", "scroll"], {direction: [GenericSync.DIRECTION_X, GenericSync.DIRECTION_Y]}); var _lastSyncStartTime = new Date(); cubeSync.on('start', function(){ var currentTime = new Date(); if(currentTime - _lastSyncStartTime < DOUBLE_TAP_THRESHOLD){ $scope.handleDoubleTap(); } _lastSyncStartTime = currentTime; //shrink cube _scale.halt(); _scale.set([.8, .8, .8], TRANSITIONS.SCALE) }); cubeSync.on('update', function(data){ var newRotate = _rotate.get(); newRotate[0] -= data.delta[1] * CUBE_SCROLL_SPEED; newRotate[1] += data.delta[0] * CUBE_SCROLL_SPEED; _rotate.set.call(_rotate, newRotate); }); cubeSync.on('end', function(data){ //handle snapping to nearest facet var rotate = _rotate.get().slice(0); //ideal rotate values var idealX = 0; //since there are 4 faces, we want to snap to y-rotations of 0, π/2, π, 3π/2 var idealY = Math.PI * Math.round(2 * rotate[1] / Math.PI) / 2; rotate[0] = idealX; rotate[1] = idealY; _rotate.set(rotate, TRANSITIONS.ROTATE); _scale.halt(); //grow cube back _scale.set([1, 1, 1], TRANSITIONS.SCALE) }) $scope.cubeHandler = new EventHandler(); $scope.cubeHandler.pipe(cubeSync); $scope.handlers = [$scope.cubeHandler, $scope.scrollHandler]; var _rotate = new Transitionable([0,0,0]); $scope.getRotate = function(){ return _rotate.get(); }; var _scale = new Transitionable([1,1,1]); $scope.getScale = function(){ return _scale.get(); } });
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @namespace Phaser.Renderer.WebGL */ module.exports = { Utils: require('./Utils'), WebGLPipeline: require('./WebGLPipeline'), WebGLRenderer: require('./WebGLRenderer'), Pipelines: require('./pipelines'), // Constants BYTE: 0, SHORT: 1, UNSIGNED_BYTE: 2, UNSIGNED_SHORT: 3, FLOAT: 4 };
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let InsertChart = props => <SvgIcon {...props}> <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z" /> </SvgIcon>; InsertChart = pure(InsertChart); InsertChart.muiName = 'SvgIcon'; export default InsertChart;
var zmq = require('../'); var sock = zmq.socket('push'); sock.bindSync('tcp://127.0.0.1:3000'); console.log('Producer bound to port 3000'); setInterval(function(){ console.log('sending work'); sock.send('some work'); }, 500);
import React from 'react' import renderer from 'react-test-renderer' import Camera from '.' jest.mock('react-dom') describe('Camera', () => { it('renders <a-entity>', () => { const tree = renderer.create(<Camera />).toJSON() expect(tree.type).toBe('a-entity') }) })
"use strict"; var AppConstants = require('../constants/AppConstants'); var AppDispatcher = require('../dispatcher/AppDispatcher'); var EventEmitter = require('events').EventEmitter; var assign = require('object-assign'); var ActionTypes = AppConstants.ActionTypes; var DEFAULT_LOCALE = 'en_US'; // resolve the messy mapping between browser language // and our supported locales var langLocaleMap = { en: 'en_US', zh: 'zh_CN', ja: 'ja', ko: 'ko', es: 'es_AR', fr: 'fr_FR', de: 'de_DE', pt: 'pt_BR' }; var headerLocaleMap = { 'zh-CN': 'zh_CN', 'zh-TW': 'zh_TW', 'pt-BR': 'pt_BR' }; function _getLocaleFromHeader(langString) { var languages = langString.split(','); var desiredLocale; for (var i = 0; i < languages.length; i++) { var header = languages[i].split(';')[0]; // first check the full string raw if (headerLocaleMap[header]) { desiredLocale = headerLocaleMap[header]; break; } var lang = header.slice(0, 2); if (langLocaleMap[lang]) { desiredLocale = langLocaleMap[lang]; break; } } return desiredLocale; } var _locale = DEFAULT_LOCALE; var LocaleStore = assign( {}, EventEmitter.prototype, AppConstants.StoreSubscribePrototype, { getDefaultLocale: function() { return DEFAULT_LOCALE; }, getLangLocaleMap: function() { return assign({}, langLocaleMap); }, getHeaderLocaleMap: function() { return assign({}, headerLocaleMap); }, getLocale: function() { return _locale; }, dispatchToken: AppDispatcher.register(function(payload) { var action = payload.action; var shouldInform = false; switch (action.type) { case ActionTypes.CHANGE_LOCALE: _locale = action.locale; shouldInform = true; break; case ActionTypes.CHANGE_LOCALE_FROM_HEADER: var value = _getLocaleFromHeader(action.header); if (value) { _locale = value; shouldInform = true; } break; } if (shouldInform) { LocaleStore.emit(AppConstants.CHANGE_EVENT); } }) }); module.exports = LocaleStore;
import Experiments from '../../classes/Experiments' import Field from './Field' import Particle from './Particle' import { randomArbitrary, randomInteger } from '../../utils/random' export default class Flow extends Experiments { constructor () { super() this.field = null this.particles = null this.particlesLength = null this.particlesColor = null this.createField() this.createParticles() this.update() } createField () { this.field = new Field() } createParticle () { const index = randomInteger(0, this.colors.length - 1) const x = randomInteger(0, window.innerWidth) const y = randomInteger(0, window.innerHeight) const color = this.colors[this.particlesColor][index] const radius = randomArbitrary(1, 6) const speed = randomInteger(4, 12) const force = randomArbitrary(0.4, 1) const particle = new Particle(x, y, color, radius, speed, force) this.particles.push(particle) } createParticles () { this.particles = [] this.particlesLength = 1000 this.particlesColor = randomInteger(0, this.colors.length - 1) for (let i = 0; i <= this.particlesLength; i++) { this.createParticle() } } update () { super.update() this.stats.begin() this.field.update() this.particles.forEach((particle, index) => { particle.follow(this.field) particle.update() particle.check() particle.draw(this.context) }) this.context.globalAlpha = 1 this.context.globalCompositeOperation = 'source-over' this.context.fillStyle = 'rgba(0, 0, 0, 0.1)' this.context.fillRect(0, 0, window.innerWidth, window.innerHeight) this.stats.end() } dblclick () { super.dblclick() this.createField() this.createParticles() } resize () { super.resize() this.createField() this.createParticles() } }
module.exports = function( grunt ) { grunt.initConfig({ pkg: grunt.file.readJSON( 'package.json' ), jshint: { all: [ 'js/**/*.js' ] }, gitinfo: {}, clean: { dist: [ 'dist' ] }, update_json: { options: { src: 'package.json', indent: 2 }, bower: { dest: 'bower.json', fields: [ 'name', 'version', 'main', 'description', 'keywords', 'homepage', 'license' ] } }, browserify: { dist: { options: { banner: '<%= pkg.config.banner %>\n', plugin: [[ 'browserify-derequire' ]], browserifyOptions: { paths: [ 'js' , 'bower_components' ], debug: 'debug', standalone: 'hxManager' } }, files: { 'dist/hx.js': 'js/main.js' } }, test: { options: { transform: [ [ 'babelify' , { stage: 0 }], [ 'browserify-shim' ] ], browserifyOptions: { paths: [ 'dist' , 'bower_components' ] } }, files: { 'test/hx-module.compiled.js': 'test/hx-module.js' } } }, exorcise: { dist: { files: { 'dist/hx.js.map': 'dist/hx.js' } } }, watch: { debug: { files: [ 'js/**/*.js' ], tasks: [ 'build' ] } }, connect: { debug: { options: { port: 9001, base: '.', hostname: '0.0.0.0', interrupt: true } } }, uglify: { options: { banner: '<%= pkg.config.banner %>', sourceMap: true, sourceMapIn: 'dist/hx.js.map', screwIE8: true }, release: { files: { 'dist/hx.min.js': 'dist/hx.js' } } }, karma: { unit: { configFile: 'test/karma.conf.js', singleRun: true } }, 'release-describe': { dist: { files: { 'dist/hx.min.js': 'dist/hx.js' } } } }); grunt.loadTasks( 'tasks' ); [ 'grunt-contrib-jshint', 'grunt-contrib-clean', 'grunt-contrib-uglify', 'grunt-contrib-watch', 'grunt-contrib-connect', 'grunt-update-json', 'grunt-gitinfo', 'grunt-browserify', 'grunt-exorcise', 'grunt-karma' ] .forEach( grunt.loadNpmTasks ); grunt.registerTask( 'default' , [ 'build', 'uglify', 'update_json', 'release-describe' ]); grunt.registerTask( 'build' , [ 'jshint', 'gitinfo', 'clean', 'browserify', 'exorcise' ]); grunt.registerTask( 'test' , function() { try { grunt.task.requires( 'build' ); } catch( err ) { grunt.task.run( 'build' ); } grunt.task.run([ 'connect' , 'karma:unit' ]); }); grunt.registerTask( 'debug' , [ 'build', 'connect', 'watch:debug' ]); };
'use strict'; var extend = require('lodash/extend'); var oo = require('../util/oo'); function I18n() { this.map = {}; } I18n.Prototype = function() { this.t = function(key) { if (this.map[key]) { return this.map[key]; } else { return key; } }; this.load = function(map) { extend(this.map, map); }; }; oo.initClass(I18n); I18n.mixin = function(ComponentClass) { Object.defineProperty(ComponentClass.prototype, 'i18n', { get: function() { // support for Substance.Components (using dependency injection) if (this.context && this.context.i18n) { return this.context.i18n; } // support for usage via singleton else { return I18n.instance; } } }); }; I18n.instance = new I18n(); module.exports = I18n;
var lib = 'lib'; var run = lib + '/run'; var depend = run + '/depend'; var licenses = run + '/licenses'; var demo = lib + '/demo'; var test = lib + '/test'; var config = lib + '/config'; var cleanDirs = [ lib ]; var dependencies = [ { name: 'mcagar', repository: 'buildrepo2', source: 'mcagar.zip', targets: [ { name: 'module/*.js', path: test }, { name: 'depend/*.js', path: test } ] } ];
"use strict"; var zetzer = require("./index"); var pages = "node_modules/grunt-zetzer/spec/fixtures"; var partials = "node_modules/grunt-zetzer/spec/includes"; var templates = "node_modules/grunt-zetzer/spec/templates"; var site = zetzer({ pages: pages, partials: partials, templates: templates }); module.exports = site;
'use strict'; describe('Controller: OauthButtonsCtrl', function() { // load the controller's module beforeEach(module('healthApp')); var OauthButtonsCtrl, $window; // Initialize the controller and a mock $window beforeEach(inject(function($controller) { $window = { location: {} }; OauthButtonsCtrl = $controller('OauthButtonsCtrl', { $window: $window }); })); it('should attach loginOauth', function() { OauthButtonsCtrl.loginOauth.should.be.a('function'); }); });
import React from 'react'; import { shallow } from 'enzyme'; import EventLocationFilter from './EventLocationFilter'; describe('Component: <EventLocationFilter />', () => { const props = {}; beforeEach(() => { props.updateFilters = jest.fn(); props.disableGeoLocation = jest.fn(); }); it('renders without crashing', () => { const div = document.createElement('div'); shallow(<EventLocationFilter {...props} />, div); }); it('should toggle the menu open and closed on button click', () => { const wrapper = shallow(<EventLocationFilter {...props} />); const btn = wrapper.find('button').first(); expect(wrapper.state('menuOpen')).toBe(false); btn.simulate('click', { stopPropagation: () => {} }); expect(wrapper.state('menuOpen')).toBe(true); btn.simulate('click', { stopPropagation: () => {} }); expect(wrapper.state('menuOpen')).toBe(false); }); it('should clear zipcode input and call onUpdate when clear btn is pressed', () => { const wrapper = shallow(<EventLocationFilter {...props} />); const btn = wrapper.find('input[type="button"]'); // second <button> btn.simulate('click'); btn.simulate('click'); expect(wrapper.state('location')).toBe(''); expect(props.updateFilters).toHaveBeenCalledTimes(2); }); it('should call the updateFilters func', () => { const wrapper = shallow(<EventLocationFilter {...props} />); wrapper.find('input[type="submit"]').simulate('click', { preventDefault: () => {} }); expect(props.updateFilters).toHaveBeenCalledTimes(1); expect(wrapper.state('menuOpen')).toBe(false); }); it('should properly set location error message state', () => { const wrapper = shallow(<EventLocationFilter {...props} />); const invalidZipcode1 = '123'; const invalidZipcode2 = '123b5'; const invalidZipcode3 = '123456'; const invalidZipcode4 = '123 45'; const validZipcode1 = '12345'; // Invalid wrapper.instance().validateLocation(invalidZipcode1); expect(wrapper.state('locationErrorMsg')).toBeTruthy(); wrapper.instance().validateLocation(invalidZipcode2); expect(wrapper.state('locationErrorMsg')).toBeTruthy(); wrapper.instance().validateLocation(invalidZipcode3); expect(wrapper.state('locationErrorMsg')).toBeTruthy(); wrapper.instance().validateLocation(invalidZipcode4); expect(wrapper.state('locationErrorMsg')).toBeTruthy(); // Valid wrapper.instance().validateLocation(validZipcode1); expect(wrapper.state('locationErrorMsg')).toBeNull(); }); });
var GitHubApi = require("github"); module.exports = function(config) { var accessToken = (config.accessToken) ? config.accessToken : false, github = new GitHubApi({ version: config.version || "3.0.0", debug: config.debug || false, protocol: "https", host: config.host || "api.github.com", timeout: config.timeout || 5000, headers: { "user-agent": "BB8 Commander" } }); if(accessToken) { github.authenticate({ type: 'oauth', token: accessToken }); } return github; };
sc.define("obtain", { Array: function(index, defaultValue) { if (Array.isArray(index)) { return index.map(function(index) { return this.obtain(index, defaultValue); }, this); } index = Math.max(0, index|0); if (index < this.length) { return this[index|0]; } return defaultValue; } });
const specs = require('../support/controllers/categories'); describe('Controller Categories', () => { const names = ['getCategories', 'createCategory', 'getCategoryById']; _.each(names, (name) => { describe(`#${name}`, () => { const spec = specs[name]; beforeEach('nock requests', spec.nockRequest); it('resolve promise', spec.promiseResolved); it('resolve correct response', spec.correctInstance); it('resolve correct content', spec.correctContent); }); }); });
'use strict'; /** * @ngdoc overview * @name directive.numeric */ angular.module('backAnd.directives') .directive('numeric', ['$log', function ($log) { /** * @ngdoc directive * @name directive.numeric * @description numeric element * @param {object} field, required, field configuration and data * @param {object} value, optional, value of the field, could be null * @param {object} form, required, the form that contains the field * @param {string} inputClass, optional, optional css class * @param {string} errors, optional, error messages * @returns {object} directive */ return { restrict: 'A', replace: true, scope: { field: "=", value: "=", form: "=", inputClass: "=", errors: "=" }, templateUrl: 'backand/js/directives/numeric/partials/numeric.html', link: function(scope) { $log.debug("numeric scope", scope); if (!scope.value.val){ scope.value.val = scope.field.defaultValue; }; } } }]);
/*! * remark v1.0.6 (http://getbootstrapadmin.com/remark) * Copyright 2015 amazingsurge * Licensed under the Themeforest Standard Licenses */ $.components.register("paginator", { mode: "init", defaults: { namespace: "pagination", currentPage: 1, itemsPerPage: 10, disabledClass: "disabled", activeClass: "active", visibleNum: { 0: 3, 480: 5 }, tpl: function() { return '{{prev}}{{lists}}{{next}}'; }, components: { prev: { tpl: function() { return '<li class="' + this.namespace + '-prev"><a href="javascript:void(0)"><span class="icon wb-chevron-left-mini"></span></a></li>'; } }, next: { tpl: function() { return '<li class="' + this.namespace + '-next"><a href="javascript:void(0)"><span class="icon wb-chevron-right-mini"></span></a></li>'; } }, lists: { tpl: function() { var lists = '', remainder = this.currentPage >= this.visible ? this.currentPage % this.visible : this.currentPage; remainder = remainder === 0 ? this.visible : remainder; for (var k = 1; k < remainder; k++) { lists += '<li class="' + this.namespace + '-items" data-value="' + (this.currentPage - remainder + k) + '"><a href="javascript:void(0)">' + (this.currentPage - remainder + k) + '</a></li>'; } lists += '<li class="' + this.namespace + '-items ' + this.classes.active + '" data-value="' + this.currentPage + '"><a href="javascript:void(0)">' + this.currentPage + '</a></li>'; for (var i = this.currentPage + 1, limit = i + this.visible - remainder - 1 > this.totalPages ? this.totalPages : i + this.visible - remainder - 1; i <= limit; i++) { lists += '<li class="' + this.namespace + '-items" data-value="' + i + '"><a href="javascript:void(0)">' + i + '</a></li>'; } return lists; } } } }, init: function(context) { if (!$.fn.asPaginator) return; var defaults = $.components.getDefaults("paginator"); $('[data-plugin="paginator"]', context).each(function() { var $this = $(this), options = $this.data(); var total = $this.data("total"); options = $.extend({}, defaults, options); $this.asPaginator(total, options); }); } });
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var noop = function noop() {}; var Option = function (_Component) { _inherits(Option, _Component); function Option() { _classCallCheck(this, Option); return _possibleConstructorReturn(this, (Option.__proto__ || Object.getPrototypeOf(Option)).apply(this, arguments)); } _createClass(Option, [{ key: 'render', value: function render() { var _props = this.props, eq = _props.eq, value = _props.value; return _react2.default.createElement( 'li', { key: eq, value: value }, this.props.children ); } }]); return Option; }(_react.Component); exports.default = Option;
var _ = require('lodash') var Promise = global.testPromise; var drops = [ 'sites', 'sitesmeta', 'admins', 'admins_sites', 'authors', 'authors_posts', 'blogs', 'posts', 'tags', 'posts_tags', 'comments', 'users', 'roles', 'photos', 'users_roles', 'info', 'Customer', 'Settings', 'hostnames', 'instances', 'uuid_test', 'parsed_users', 'tokens', 'thumbnails', 'lefts', 'rights', 'lefts_rights', 'organization', 'locales', 'translations' ]; module.exports = function(Bookshelf) { var schema = Bookshelf.knex.schema; return Promise.all(_.map(drops, function(val) { return schema.dropTableIfExists(val); })) .then(function() { return schema.createTable('sites', function(table) { table.increments('id'); table.string('name'); }) .createTable('sitesmeta', function(table) { table.increments('id'); table.integer('site_id').notNullable(); table.text('description'); }) .createTable('info', function(table) { table.increments('id'); table.integer('meta_id').notNullable(); table.text('other_description'); }) .createTable('admins', function(table) { table.increments('id'); table.string('username'); table.string('password'); table.timestamps(); }) .createTable('admins_sites', function(table) { table.increments('id'); table.integer('admin_id').notNullable(); table.integer('site_id').notNullable(); table.string('item').defaultTo('test'); }) .createTable('blogs', function(table) { table.increments('id'); table.integer('site_id').notNullable(); table.string('name'); }) .createTable('authors', function(table) { table.increments('id'); table.integer('site_id').notNullable(); table.string('first_name'); table.string('last_name'); }) .createTable('posts', function(table) { table.increments('id'); table.integer('owner_id').notNullable(); table.integer('blog_id').notNullable(); table.string('name'); table.text('content'); }) .createTable('authors_posts', function(table) { table.increments('id'); table.integer('author_id').notNullable(); table.integer('post_id').notNullable(); }) .createTable('tags', function(table) { table.increments('id'); table.string('name'); }) .createTable('posts_tags', function(table) { table.increments('id'); table.integer('post_id').notNullable(); table.integer('tag_id').notNullable(); }) .createTable('comments', function(table) { table.increments('id'); table.integer('post_id').notNullable(); table.string('name'); table.string('email'); table.text('comment'); }) .createTable('users', function(table) { table.increments('uid'); table.string('username'); }) .createTable('roles', function(table) { table.increments('rid'); table.string('name'); }) .createTable('users_roles', function(table) { table.integer('rid').notNullable(); table.integer('uid').notNullable(); }) .createTable('photos', function(table) { table.increments('id'); table.string('url'); table.string('caption'); table.integer('imageable_id').notNullable(); table.string('imageable_type'); }) /* The following table is for testing non-standard morphTo column name * specification. The breaking of naming convention is intentional. * Changing it back to snake_case will break the tests! */ .createTable('thumbnails', function(table) { table.increments('id'); table.string('url'); table.string('caption'); table.integer('ImageableId').notNullable(); table.string('ImageableType'); }) .createTable('Customer', function(table) { table.increments('id'); table.string('name'); }) .createTable('Settings', function(table) { table.increments('id'); table.integer('Customer_id').notNullable(); table.string('data', 64); }) .createTable('hostnames', function(table){ table.string('hostname'); table.integer('instance_id').notNullable(); table.enu('route', ['annotate','submit']); }) .createTable('instances', function(table){ table.bigIncrements('id'); table.string('name'); }) .createTable('uuid_test', function(table) { table.uuid('uuid'); table.string('name'); }) .createTable('parsed_users', function(table) { table.increments(); table.string('name'); }) .createTable('tokens', function(table) { table.increments(); table.string('parsed_user_id'); table.string('token'); }) // .createTable('lefts', function(table) { table.increments(); }) .createTable('rights', function(table) { table.increments(); }) .createTable('lefts_rights', function(table) { table.increments(); table.string('parsed_name'); table.integer('left_id').notNullable(); table.integer('right_id').notNullable(); }) .createTable('organization', function(table) { table.increments('organization_id'); table.string('organization_name').notNullable(); table.boolean('organization_is_active').defaultTo(false); }) .createTable('locales', function(table) { table.string('isoCode'); }) .createTable('translations', function(table) { table.string('code'); table.string('customer'); }) }); };
import _JSXStyle from "styled-jsx/style"; export default (()=><div className={"jsx-1a19bb4817c105dd"}> <p className={"jsx-1a19bb4817c105dd"}>test</p> <_JSXStyle id={"1a19bb4817c105dd"}>{"p.jsx-1a19bb4817c105dd{color:red}\np.jsx-1a19bb4817c105dd{color:red}\n*.jsx-1a19bb4817c105dd{color:blue}\n[href=\"woot\"].jsx-1a19bb4817c105dd{color:red}"}</_JSXStyle> </div> );
import { Controller, Service, inject } from 'ember-runtime'; import { run } from 'ember-metal'; import { QueryParamTestCase, moduleFor } from 'internal-test-helpers'; moduleFor( 'Query Params - shared service state', class extends QueryParamTestCase { boot() { this.setupApplication(); return this.visitApplication(); } setupApplication() { this.router.map(function() { this.route('home', { path: '/' }); this.route('dashboard'); }); this.add( 'service:filters', Service.extend({ shared: true, }) ); this.add( 'controller:home', Controller.extend({ filters: inject.service(), }) ); this.add( 'controller:dashboard', Controller.extend({ filters: inject.service(), queryParams: [{ 'filters.shared': 'shared' }], }) ); this.addTemplate('application', `{{link-to 'Home' 'home' }} <div> {{outlet}} </div>`); this.addTemplate( 'home', `{{link-to 'Dashboard' 'dashboard' }}{{input type="checkbox" id='filters-checkbox' checked=(mut filters.shared) }}` ); this.addTemplate('dashboard', `{{link-to 'Home' 'home' }}`); } visitApplication() { return this.visit('/'); } ['@test can modify shared state before transition'](assert) { assert.expect(1); return this.boot().then(() => { this.$input = document.getElementById('filters-checkbox'); // click the checkbox once to set filters.shared to false run(this.$input, 'click'); return this.visit('/dashboard').then(() => { assert.ok(true, 'expecting navigating to dashboard to succeed'); }); }); } ['@test can modify shared state back to the default value before transition'](assert) { assert.expect(1); return this.boot().then(() => { this.$input = document.getElementById('filters-checkbox'); // click the checkbox twice to set filters.shared to false and back to true run(this.$input, 'click'); run(this.$input, 'click'); return this.visit('/dashboard').then(() => { assert.ok(true, 'expecting navigating to dashboard to succeed'); }); }); } } );
this.onmessage = function(event) { console.log("Got message in SW", event.data.text); if (event.source) { console.log("event.source present"); event.source.postMessage("Woop!"); } else if (self.clients) { console.log("Attempting postMessage via clients API"); clients.matchAll().then(function(clients) { for (var client of clients) { client.postMessage("Whoop! (via client api)"); } }); } else if (event.data.port) { event.data.port.postMessage("Woop!"); } else { console.log('No useful return channel'); } };
// Avoid `console` errors in browsers that lack a console. (function() { var method; var noop = function () {}; var methods = [ 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn' ]; var length = methods.length; var console = (window.console = window.console || {}); while (length--) { method = methods[length]; // Only stub undefined methods. if (!console[method]) { console[method] = noop; } } }()); width = document.body.clientWidth; /* if (width>750) { particlesJS('particles-js', { "particles": { "number": { "value": 80, "density": { "enable": true, "value_area": 800 } }, "color": { "value": "#b61924" }, "shape": { "type": "circle", "stroke": { "width": 0, "color": "#000000" }, "polygon": { "nb_sides": 5 }, "image": { "src": "img/github.svg", "width": 100, "height": 100 } }, "opacity": { "value": 0.5, "random": false, "anim": { "enable": false, "speed": 1, "opacity_min": 0.1, "sync": false } }, "size": { "value": 5, "random": true, "anim": { "enable": false, "speed": 40, "size_min": 0.1, "sync": false } }, "line_linked": { "enable": true, "distance": 150, "color": "#b61924", "opacity": 0.4, "width": 1 }, "move": { "enable": true, "speed": 4, "direction": "none", "random": false, "straight": false, "out_mode": "out", "attract": { "enable": false, "rotateX": 600, "rotateY": 1200 } } }, "interactivity": { "detect_on": "canvas", "events": { "onhover": { "enable": true, "mode": "repulse" }, "onclick": { "enable": true, "mode": "push" }, "resize": true }, "modes": { "grab": { "distance": 400, "line_linked": { "opacity": 1 } }, "bubble": { "distance": 400, "size": 40, "duration": 2, "opacity": 8, "speed": 3 }, "repulse": { "distance": 200 }, "push": { "particles_nb": 4 }, "remove": { "particles_nb": 2 } } }, "retina_detect": true, "config_demo": { "hide_card": false, "background_color": "#b61924", "background_image": "", "background_position": "50% 50%", "background_repeat": "no-repeat", "background_size": "cover" } } ); }*/
'use strict'; const TYPES = { MASTER: 'Master', OSCILLATOR: 'Oscillator', NOISE: 'Noise', MODULATOR: 'Modulator', ENVELOPE: 'Envelope', PAN: 'Pan', FILTER: 'Filter', DELAY: 'Delay', PINGPONGDELAY: 'PingPongDelay', TREMOLO: 'Tremolo', OVERDRIVE: 'Overdrive', BITCRUSHER: 'Bitcrusher', MOOGFILTER: 'MoogFilter' }, CONST = { MASTER: 'master', ADSR: 'adsr', NOISE_WHITE: 'white', NOISE_PINK: 'pink', NOISE_BROWN: 'brown', WAVE_SINE: 'sine', WAVE_SQUARE: 'square', WAVE_SAWTOOTH: 'sawtooth', WAVE_TRIANLGE: 'triangle', WAVE_CUSTOM: 'custom', FILTER_LOWPASS: 'lowpass', FILTER_HIGHPASS: 'highpass', FILTER_BANDPASS: 'bandpass', FILTER_LOWSHELF: 'lowshelf', FILTER_HIGHSHELF: 'highshelf', FILTER_PEAKING: 'peaking', FILTER_NOTCH: 'notch', FILTER_ALLPASS: 'allpass', MODULATOR_TARGET_FREQ: 'frequency', MODULATOR_TARGET_DETUNE: 'detune', ENVELOPE_TARGET_GAIN: 'gain', ENVELOPE_TARGET_FREQ: 'frequency', ENVELOPE_TARGET_DETUNE: 'detune' }; export { TYPES, CONST };
import Layout from '../components/layout' import Sidebar from '../components/sidebar' export default function Contact() { return ( <section> <h2>Layout Example (Contact)</h2> <p> This example adds a property <code>getLayout</code> to your page, allowing you to return a React component for the layout. This allows you to define the layout on a per-page basis. Since we're returning a function, we can have complex nested layouts if desired. </p> <p> When navigating between pages, we want to persist page state (input values, scroll position, etc) for a Single-Page Application (SPA) experience. </p> <p> This layout pattern will allow for state persistence because the React component tree is persisted between page transitions. To preserve state, we need to prevent the React component tree from being discarded between page transitions. </p> <h3>Try It Out</h3> <p> To visualize this, try tying in the search input in the{' '} <code>Sidebar</code> and then changing routes. You'll notice the input state is persisted. </p> </section> ) } Contact.getLayout = function getLayout(page) { return ( <Layout> <Sidebar /> {page} </Layout> ) }
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { getScatterPlot, updateWidth, updateHeight, updateTop, updateBottom, updateRight, updateLeft, update_x_name, update_x_nameColor, update_x_ticks, update_x_axisColor, update_y_name, update_y_nameColor, update_y_ticks, update_y_axisColor } from '../actions/ScatterPlotActions'; import { getD3ParserObj, updateValue } from '../actions/D3ParserActions'; import { ScatterPlotReducer, D3ParserReducer } from '../reducers/index'; import AttrListItem from '../components/attributes/d3-parsed/AttrListItem'; import Dimensions from '../components/attributes/scatter-plot/Dimensions'; import Axes from '../components/attributes/scatter-plot/Axes'; import LocalAttributes from '../components/attributes/scatter-plot/LocalAttributes'; import Data from '../components/attributes/scatter-plot/Data'; const d3parser = require('../d3-parser/d3parser'); import { editor } from '../components/editor/textEditor'; import fs from 'fs'; const { ipcRenderer } = require('electron'); class AttributesPanel extends Component { componentDidMount() { let fileUpLoadBtn = document.getElementById('upload-file'); fileUpLoadBtn.addEventListener('change', (event) => { setTimeout(() => { this.props.getD3ParserObj(); this.forceUpdate(); }, 0) }); ipcRenderer.on('updateAttr', (event) => { this.props.getD3ParserObj(); this.forceUpdate(); }); } handleSubmit(e, obj) { e.preventDefault(); let d3string = JSON.stringify(obj, null, '\t') fs.writeFileSync('./src/d3ParserObj.js', d3string); let htmlString = d3parser.reCode(JSON.parse(d3string)); fs.writeFileSync('./src/components/temp/temp.html', htmlString); editor.setValue(htmlString); document.querySelector('webview').reload(); ipcRenderer.send('updateNewWebView'); } render() { // State from ScatterPlotReducer const ScatterPlotObj = this.props.ScatterPlotReducer; // Attributes For Scatter Plot const margin = ScatterPlotObj.margin; const width = ScatterPlotObj.width; const height = ScatterPlotObj.height; const responsiveResize = ScatterPlotObj.responsiveResize; const axes = ScatterPlotObj.axes; const gridLines = ScatterPlotObj.gridLines; const regressionLine = ScatterPlotObj.regressionLine; const toolTip = ScatterPlotObj.toolTip; const scatterPlot = ScatterPlotObj.scatterPlot; const data = ScatterPlotObj.data; const D3ParserObj = this.props.D3ParserReducer; if (D3ParserObj.length > 0) { const attrObj = D3ParserObj.filter((el, i) => { if (typeof el === 'object' && el.hasOwnProperty('args')) { el.id = i; return true; } }); let sortedAttr = []; for (let i = 0; i < attrObj.length; i += 1) { let objholder = [attrObj[i]]; if (attrObj[i+1] && objholder[0].methodObject !== "d3" && objholder[0].methodObject === attrObj[i+1].methodObject) { for (let j = i + 1; j < attrObj.length; j += 1) { if (objholder[0].methodObject === attrObj[j].methodObject) { objholder.push(attrObj[j]); } else { break; } i = j; } } sortedAttr.push(objholder); } const attrList = sortedAttr.map((arr, i) => { return <AttrListItem key={i} updateValue={this.props.updateValue} info={arr} /> }); return ( <div className="pane-one-fourth"> <header className="toolbar toolbar-header attr-main-header"> <h1 className="title main-header">Attributes Panel</h1> <button className="btn btn-primary generate-btn" id="d3parser" onClick={(e)=>getD3ParserObj()}> Generate </button> </header> <div id="attr-panel"> <div className="parsed-attr-container"> <form id="attrForm" onSubmit={(e) => this.handleSubmit(e, D3ParserObj)}> {attrList} </form> </div> </div> <div className="submit-btn"> <button type="submit" className="btn btn-default attr-submit-btn" form="attrForm">Save</button> </div> </div> ) } return ( <div className="pane-one-fourth"> <header className="toolbar toolbar-header attr-main-header"> <h1 className="title main-header">Attributes Panel</h1> <button className="btn btn-default generate-btn" id="d3parser" onClick={(e) => getD3ParserObj()}> Generate </button> </header> <div id="attr-panel"> <Dimensions margin={margin} width={width} height={height} responsiveResize={responsiveResize} controlWidth={this.props.updateWidth} controlHeight={this.props.updateHeight} controlTop={this.props.updateTop} controlBottom={this.props.updateBottom} controlRight={this.props.updateRight} controlLeft={this.props.updateLeft} /> <Axes axes={axes} controlNameX={this.props.update_x_name} controlXnameColor={this.props.update_x_nameColor} controlXticks={this.props.update_x_ticks} controlColorAxisX={this.props.update_x_axisColor} controlNameY={this.props.update_y_name} controlYNameColor={this.props.update_y_nameColor} controlYticks={this.props.update_y_ticks} controlColorAxisY={this.props.update_y_axisColor} /> <LocalAttributes gridLines={gridLines} regressionLine={regressionLine} tooTip={toolTip} scatterPlot={scatterPlot} /> <Data /> </div> <div className="submit-btn"> <button className="btn btn-default attr-submit-btn" type="submit">Save</button> </div> </div> ); } } function mapStateToProps({ ScatterPlotReducer, D3ParserReducer }) { return { ScatterPlotReducer, D3ParserReducer } } function mapDispatchToProps(dispatch) { return bindActionCreators({ getScatterPlot, updateWidth, getD3ParserObj, updateValue, updateHeight, updateTop, updateBottom, updateRight, updateLeft, update_x_name, update_x_nameColor, update_x_ticks, update_x_axisColor, update_y_name, update_y_nameColor, update_y_ticks, update_y_axisColor }, dispatch); } export default connect(mapStateToProps, mapDispatchToProps)(AttributesPanel);
/** * A simple example demonstrating how to produce JSON for the * Tropo WebAPI. Execute by doing: * ~$ node path/to/tropo-webapi-node/samples/sample-1.js */ var tropowebapi = require('tropo-webapi'); var sys = require('sys'); // Create a new instance of the TropoWebAPI object. var tropo = new tropowebapi.TropoWebAPI(); // Say something and then hangup. (Note, null values are excluded from rendered JSON.) tropo.say("Hello, World.", null, null, true, "carmen"); tropo.hangup(); // Write out the rendered JSON. sys.puts(tropowebapi.TropoJSON(tropo));
const PartsPage = () => { return <div className="title">Parts page</div> } export default PartsPage
"use strict"; $(function() { var $searchField = $("#search-field"), $popularTags = $("#popular-tags"), showTags, hideTags; showTags = function() { return $popularTags.show(); }; hideTags = function() { return $popularTags.hide(); }; return $searchField.ghostHunter({ results: "#search-results", zeroResultsInfo: false, onKeyUp: true, displaySearchInfo: true, result_template: "<a id='gh-{{ref}}' class=\"gh-search-item\" href='{{link}}'>\n <h2>{{title}}</h2>\n <h4>{{pubDate}}</h4>\n</a>", onComplete: function(query) { if (query.length > 0) { return hideTags(); } else { return showTags(); } } }); });
version https://git-lfs.github.com/spec/v1 oid sha256:04dbdeb923ad723de01b071314073ff991ac19f38d453f2c72937ba5348fc66c size 30499
/** * * @providesModule SMXIconImage * @flow */ 'use strict'; var React = require('react-native'); var { StyleSheet, View, requireNativeComponent, processColor} = React; var shimAssert = require('./shim-assert'); var ICON_REF = 'icon'; class IconImage extends React.Component { setNativeProps(props:Object) { this.refs[ICON_REF].setNativeProps(props); } render() { var style = [styles.base, this.props.style]; shimAssert.basic( style, 'style must be initialized'); var name = this.props.name; shimAssert.basic( name, 'name must be initialized'); var size = this.props.size; shimAssert.basic( size, 'size must be initialized'); var color = this.props.color; var nativeProps = Object.assign({},this.props); if(!color && style.color) { nativeProps.color = processColor(style.color); } nativeProps.style = style; return <RCTMyCustomView {...nativeProps} ref={ICON_REF} />; } } var styles = StyleSheet.create({ base: { overflow: 'hidden' } }); IconImage.propTypes = { name: React.PropTypes.string, color: React.PropTypes.string, size: React.PropTypes.number, scaleX: React.PropTypes.number, scaleY: React.PropTypes.number, translateX: React.PropTypes.number, translateY: React.PropTypes.number, rotation: React.PropTypes.number, }; var RCTMyCustomView = requireNativeComponent('SMXIconImage', IconImage); module.exports = IconImage;
var example = { drawOnCanvas: function(width, height, gradient, canvasId) { canvasId = canvasId || 'canvas'; var canvas = document.getElementById(canvasId); var ctx = canvas.getContext('2d'); var imageData = ctx.createImageData(width, height); var buffer = imageData.data.buffer; var uint32View = new Uint32Array(buffer); var uint8CView = new Uint8ClampedArray(buffer); canvas.width = width; canvas.height = height; for(var x = 0; x < width; x++) { for(var y = 0; y < height; y++) { var rgb = gradient(x, y); uint32View[y * width + x] = colorutil.rgb.to.intabgr(rgb); } } imageData.data.set(uint8CView); ctx.putImageData(imageData, 0, 0); }, drawOnCanvasHSV: function(width, height, gradient, canvasId) { canvasId = canvasId || 'canvas'; var canvas = document.getElementById(canvasId); var ctx = canvas.getContext('2d'); var imageData = ctx.createImageData(width, height); var buffer = imageData.data.buffer; var uint32View = new Uint32Array(buffer); var uint8CView = new Uint8ClampedArray(buffer); canvas.width = width; canvas.height = height; for(var x = 0; x < width; x++) { for(var y = 0; y < height; y++) { var hsv = gradient(x, y); var rgb = colorutil.hsv.to.rgb(hsv); uint32View[y * width + x] = colorutil.rgb.to.intabgr(rgb); } } imageData.data.set(uint8CView); ctx.putImageData(imageData, 0, 0); }, drawOnCanvasHSL: function(width, height, gradient, canvasId) { canvasId = canvasId || 'canvas'; var canvas = document.getElementById(canvasId); var ctx = canvas.getContext('2d'); var imageData = ctx.createImageData(width, height); var buffer = imageData.data.buffer; var uint32View = new Uint32Array(buffer); var uint8CView = new Uint8ClampedArray(buffer); canvas.width = width; canvas.height = height; for(var x = 0; x < width; x++) { for(var y = 0; y < height; y++) { var hsl = gradient(x, y); var rgb = colorutil.hsl.to.rgb(hsl); uint32View[y * width + x] = colorutil.rgb.to.intabgr(rgb); } } imageData.data.set(uint8CView); ctx.putImageData(imageData, 0, 0); } }
var SelectListView = require('atom-space-pen-views').SelectListView; exports.selectListViewStaticInlineImpl = function(viewForItem, confirmed, filterKey, items) { function PurescriptSelectListView() { SelectListView.call(this); this.addClass('overlay'); this.addClass('ps-inline-overlay'); } PurescriptSelectListView.prototype = Object.create(SelectListView.prototype); PurescriptSelectListView.prototype.viewForItem = viewForItem; PurescriptSelectListView.prototype.show = function() { list.storeFocusedElement(); var editor = atom.workspace.getActiveTextEditor() , marker = editor.getLastCursor().getMarker(); this.panel = editor.decorateMarker(marker, { type: "overlay", position: "tail", item: this }); setTimeout(function() { list.focusFilterEditor(); }, 20); }; PurescriptSelectListView.prototype.confirmed = function(item) { confirmed(item); this.panel && this.panel.destroy(); this.restoreFocus(); }; PurescriptSelectListView.prototype.cancelled = function() { this.panel && this.panel.destroy(); this.restoreFocus(); }; PurescriptSelectListView.prototype.getFilterKey = function() { return filterKey; }; var list = new PurescriptSelectListView(); list.setItems(items); list.show(); return {}; } exports.selectListViewStaticImpl = function(viewForItem, confirmed, filterKey, items) { function PurescriptSelectListView() { SelectListView.call(this); } PurescriptSelectListView.prototype = Object.create(SelectListView.prototype); PurescriptSelectListView.prototype.viewForItem = viewForItem; PurescriptSelectListView.prototype.show = function() { list.storeFocusedElement(); this.panel = atom.workspace.addModalPanel({item: list, visible: true}); list.focusFilterEditor(); }; PurescriptSelectListView.prototype.confirmed = function(item) { confirmed(item); this.panel && this.panel.destroy(); this.restoreFocus(); }; PurescriptSelectListView.prototype.cancelled = function() { this.panel && this.panel.destroy(); this.restoreFocus(); }; PurescriptSelectListView.prototype.getFilterKey = function() { return filterKey; }; var list = new PurescriptSelectListView(); list.setItems(items); list.show(); return {}; } exports.selectListViewDynamicImpl = function(viewForItem, confirmed, filterKey, filterQuery, getCompletions, changeDelay) { function PurescriptDynamicSelectListView() { SelectListView.call(this); } PurescriptDynamicSelectListView.prototype = Object.create(SelectListView.prototype); PurescriptDynamicSelectListView.prototype.viewForItem = viewForItem; PurescriptDynamicSelectListView.prototype.show = function() { list.storeFocusedElement(); this.panel = atom.workspace.addModalPanel({item: list, visible: true}); list.focusFilterEditor(); }; PurescriptDynamicSelectListView.prototype.confirmed = function(item) { confirmed(item); this.panel && this.panel.destroy(); }; PurescriptDynamicSelectListView.prototype.cancelled = function() { this.panel && this.panel.destroy(); }; PurescriptDynamicSelectListView.prototype.getFilterKey = function() { return filterKey; }; PurescriptDynamicSelectListView.prototype.getFilterQuery = function() { var baseQuery = SelectListView.prototype.getFilterQuery.call(this); return filterQuery(baseQuery); }; PurescriptDynamicSelectListView.prototype.initialize = function() { SelectListView.prototype.initialize.call(this); var searchText = ""; this.getEmptyMessage = function () { var curText = buffer.getText(); if (curText === "") { return "Enter text to search"; } else if (curText !== searchText) { // Text changing and query not made yet return ""; } else { return "No matches found"; } }; var editor = this[0].firstChild.getModel(); var buffer = editor.getBuffer(); buffer.stoppedChangingDelay = changeDelay; var that = this; this.setItems([]); function commitChanges() { var currentSearchText = buffer.getText(); getCompletions(currentSearchText).then(function (items) { searchText = currentSearchText; that.setItems(items); }); } buffer.onDidStopChanging(commitChanges); atom.commands.add(this[0].firstChild, "core:confirm", function (e) { e.stopPropagation(); commitChanges(); }); }; var list = new PurescriptDynamicSelectListView(); list.show(); return {}; }
import BaseInput from "./baseInput"; import Util from "./util"; const BaseSelection = ($ => { /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ */ const Default = { label: { required: false // Prioritized find order for resolving the label to be used as an bmd-label if not specified in the markup // - a function(thisComponent); or // - a string selector used like $bmdFormGroup.find(selector) // // Note this only runs if $bmdFormGroup.find(Selector.BMD_LABEL_WILDCARD) fails to find a label (as authored in the markup) // //selectors: [ // `.form-control-label`, // in the case of horizontal or inline forms, this will be marked // `> label` // usual case for text inputs //] } }; const Selector = { LABEL: "label" }; /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ class BaseSelection extends BaseInput { constructor($element, config, properties) { // properties = {inputType: checkbox, outerClass: checkbox-inline} // '.checkbox|switch|radio > label > input[type=checkbox|radio]' // '.${this.outerClass} > label > input[type=${this.inputType}]' super($element, $.extend(true, {}, Default, config), properties); this.decorateMarkup(); } // ------------------------------------------------------------------------ // protected decorateMarkup() { const $decorator = $(this.config.template); this.$element.after($decorator); // initialize ripples after decorator has been inserted into DOM if (this.config.ripples !== false) { $decorator.bmdRipples(); } } // Demarcation element (e.g. first child of a form-group) outerElement() { // .checkbox|switch|radio > label > input[type=checkbox|radio] // label.checkbox-inline > input[type=checkbox|radio] // .${this.outerClass} > label > input[type=${this.inputType}] return this.$element.parent().closest(`.${this.outerClass}`); } rejectWithoutRequiredStructure() { // '.checkbox|switch|radio > label > input[type=checkbox|radio]' // '.${this.outerClass} > label > input[type=${this.inputType}]' Util.assert( this.$element, !this.$element.parent().prop("tagName") === "label", `${this.constructor.name}'s ${Util.describe( this.$element )} parent element should be <label>.` ); Util.assert( this.$element, !this.outerElement().hasClass(this.outerClass), `${this.constructor.name}'s ${Util.describe( this.$element )} outer element should have class ${this.outerClass}.` ); } addFocusListener() { // checkboxes didn't appear to bubble to the document, so we'll bind these directly this.$element.closest(Selector.LABEL).hover( () => { this.addFormGroupFocus(); }, () => { this.removeFormGroupFocus(); } ); } addChangeListener() { this.$element.change(() => { this.$element.blur(); }); } // ------------------------------------------------------------------------ // private } return BaseSelection; })(jQuery); export default BaseSelection;
angular.module('starter.controllers', []) .controller('ScanCtrl', function($scope, appServices) { $scope.message = ''; $scope.click = function() { var promise = appServices.scanBarcode(); promise.then( function(result) { if (result.error == false) { var d = new Date(); $scope.message = '<table>' + '<tbody>' + '<tr><td>Timestamp:</td><td>&nbsp;</td><td>' + d.toUTCString() + '</td></tr>' + '<tr><td>Text:</td><td>&nbsp;</td><td>' + result.result.text + '</td></tr>' + '<tr><td>Format:</td><td>&nbsp;</td><td>' + result.result.format + '</td></tr>' + '<tr><td>Text:</td><td>&nbsp;</td><td>' + result.result.cancelled + '</td></tr>' + '</tbody>' + '</table>'; } else { $scope.message = '<b>ERROR</b>: ' + result; } }, function(result) { $scope.message = '' + result.error; }, function(result) { $scope.message = '' + result.error; }); } $scope.clear = function() { $scope.message = ''; } }) .controller('AboutCtrl', function($scope) { })
var checkFullPageBackgroundImage = function(){ var page = $('.full-page'); var image_src = page.data('image'); if(image_src !== undefined){ var image_container = '<div class="full-page-background" style="background-image: url(' + image_src + ') "/>' page.append(image_container); } }; $(document).ready(function(){ checkFullPageBackgroundImage(); setTimeout(function(){ // after 1000 ms we add the class animated to the login/register card $('.card').removeClass('card-hidden'); }, 700) });
// There is no single sound format that is supported // by all web browsers. For example, mp3 support is not native to // Firefox and Opera because the mp3 codec is patented. // // To ensure compatability, you can include the same sound file // in multiple formats, i.e. sound.mp3 and sound.ogg. Ogg is an // open source alternative to mp3. You can convert audio files // into web friendly formats for free online at http://media.io/ // // The soundFormats() method tells loadSound which formats we have // included with our sketch. Then, loadSound will attempt to load // the first format that is supported by the client's web browser. var song; function preload() { // we have included both an .ogg file and an .mp3 file soundFormats('ogg', 'mp3'); // if mp3 is not supported by this browser, // loadSound will load the ogg file we have included with our sketch song = loadSound('../../files/lucky_dragons_-_power_melody.mp3'); } function setup() { createCanvas(720, 200); song.play(); // song loaded during preload(), ready to play in setup() background(0,255,0); } function mousePressed() { if ( song.isPlaying() ) { // .isPlaying() returns a boolean song.pause(); background(255,0,0); } else { song.play(); // playback will resume from the pause position background(0,255,0); } }
var userController = require('./userController.js'); var express = require('express'); var userRouter = express.Router(); userRouter.post('/', userController.post); userRouter.get('/', userController.getAllUsers); userRouter.get('/:username', userController.getSpecificUser); userRouter.put('/', userController.put); userRouter.delete('/', userController.delete); module.exports = userRouter;
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon")); var _jsxRuntime = require("react/jsx-runtime"); var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", { d: "M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z" }), 'FlightSharp'); exports.default = _default;
'use strict'; var defineBusinessProcess = require('../../model/business-process-new') , Database = require('dbjs'); module.exports = function (t, a) { var db = new Database() , BusinessProcess = defineBusinessProcess(db) , businessProcess = new BusinessProcess(), paths = [], paths2; paths = ['businessName', 'abbr', 'label', 'submissionNumber']; a.deep(t(businessProcess, paths), paths); paths2 = paths.slice(0); paths.push('non-existing-prop'); a.deep(t(businessProcess, paths), paths2); paths.push({ pathFrom: 'businessName', pathTo: 'abbr' }); paths2.push({ pathFrom: 'businessName', pathTo: 'abbr' }); a.throws(function () { t(businessProcess, paths); }, new RegExp('When using path objects, you must setup isSource flag'), 'throws using path object and no isSource is specified'); a.deep(t(businessProcess, paths, { isSource: true }), paths2); var nonExistingMapping = { pathFrom: 'submissionNumber', pathTo: 'non-existing-prop' }; paths.push(nonExistingMapping); a.deep(t(businessProcess, paths, { isSource: false }), paths2); paths2.push(nonExistingMapping); // We get non existing mapping, cause we checked only the source a.deep(t(businessProcess, paths, { isSource: true }), paths2); };
//= require jquery //= require jquery_ujs //= require turbolinks // //= require react //= require react_ujs //= require semantic-ui //= require_tree ./mockup
/** * Imports ***/ import ShadersUniform from '../shaders/shaders.localizer.uniform'; import ShadersVertex from '../shaders/shaders.localizer.vertex'; import ShadersFragment from '../shaders/shaders.localizer.fragment'; /** * @module helpers/localizer */ export default class HelpersLocalizer extends THREE.Object3D { constructor(stack, geometry, referencePlane) { // super(); this._stack = stack; this._referencePlane = referencePlane; this._plane1 = null; this._color1 = null; this._plane2 = null; this._color2 = null; this._plane3 = null; this._color3 = null; this._canvasWidth = 0; this._canvasHeight = 0; this._shadersFragment = ShadersFragment; this._shadersVertex = ShadersVertex; this._uniforms = ShadersUniform.uniforms(); this._material = null; this._geometry = geometry; this._create(); } _create() { this._prepareMaterial(); this._mesh = new THREE.Mesh(this._geometry, this._material); this._mesh.applyMatrix(this._stack._ijk2LPS); this.add(this._mesh); } _prepareMaterial() { if (!this.material) { // reference plane this._uniforms.uSlice.value = this._referencePlane; // localizer planes if (this._plane1) { this._uniforms.uPlane1.value = this._plane1; this._uniforms.uPlaneColor1.value = this._color1; } if (this._plane2) { this._uniforms.uPlane2.value = this._plane2; this._uniforms.uPlaneColor2.value = this._color2; } if (this._plane3) { this._uniforms.uPlane3.value = this._plane3; this._uniforms.uPlaneColor3.value = this._color3; } // this._uniforms.uCanvasWidth.value = this._canvasWidth; this._uniforms.uCanvasHeight.value = this._canvasHeight; // generate material let fs = new ShadersFragment(this._uniforms); let vs = new ShadersVertex(); this._material = new THREE.ShaderMaterial( {side: THREE.DoubleSide, uniforms: this._uniforms, vertexShader: vs.compute(), fragmentShader: fs.compute(), }); this._material.transparent = true; } } update() { if (this._mesh) { this.remove(this._mesh); this._mesh.geometry.dispose(); this._mesh.geometry = null; this._mesh = null; } this._create(); } get geometry() { return this._geometry; } set geometry(geometry) { this._geometry = geometry; if (this._mesh) { this.remove(this._mesh); this._mesh.geometry.dispose(); this._mesh.geometry = null; this._mesh = null; } this._create(); } get referencePlane() { return this._referencePlane; } set referencePlane(referencePlane) { this._referencePlane = referencePlane; this._uniforms.uSlice.value = this._referencePlane; } get plane1() { return this._plane1; } set plane1(plane1) { this._plane1 = plane1; this._uniforms.uPlane1.value = this._plane1; } get color1() { return this._color1; } set color1(color1) { this._color1 = color1; this._uniforms.uPlaneColor1.value = this._color1; } get plane2() { return this._plane2; } set plane2(plane2) { this._plane2 = plane2; this._uniforms.uPlane2.value = this._plane2; } get color2() { return this._color2; } set color2(color2) { this._color2 = color2; this._uniforms.uPlaneColor2.value = this._color2; } get plane3() { return this._plane3; } set plane3(plane3) { this._plane3 = plane3; this._uniforms.uPlane3.value = this._plane3; } get color3() { return this._color3; } set color3(color3) { this._color3 = color3; this._uniforms.uPlaneColor3.value = this._color3; } get canvasWidth() { return this._canvasWidth; } set canvasWidth(canvasWidth) { this._canvasWidth = canvasWidth; this._uniforms.uCanvasWidth.value = this._canvasWidth; } get canvasHeight() { return this._canvasHeight; } set canvasHeight(canvasHeight) { this._canvasHeight = canvasHeight; this._uniforms.uCanvasHeight.value = this._canvasHeight; } }